{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "source": [
    ""
   ],
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:09:28.135737Z",
     "start_time": "2025-05-14T00:09:28.128565Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ],
   "id": "58b2d41baaac6af7",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "一、加载数据",
   "id": "e6114215b4ec077b"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:08:52.529991Z",
     "start_time": "2025-05-14T01:08:06.469981Z"
    }
   },
   "cell_type": "code",
   "source": [
    "user_info=pd.read_csv('用户复购预测数据/data_format1/user_info_format1.csv')\n",
    "user_log=pd.read_csv('用户复购预测数据/data_format1/user_log_format1.csv')\n",
    "train_data=pd.read_csv('用户复购预测数据/data_format1/train_format1.csv')\n",
    "test_data=pd.read_csv('用户复购预测数据/data_format1/test_format1.csv')\n",
    "sample_submission=pd.read_csv('用户复购预测数据/sample_submission.csv')"
   ],
   "id": "6b236bd88fbb1c5a",
   "outputs": [],
   "execution_count": 57
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:09:38.048361Z",
     "start_time": "2025-05-14T01:09:38.027018Z"
    }
   },
   "cell_type": "code",
   "source": "user_info.tail(10)",
   "id": "8a3c604d59a76dda",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  age_range  gender\n",
       "424160    97195        NaN     NaN\n",
       "424161    54826        3.0     1.0\n",
       "424162   156155        0.0     1.0\n",
       "424163   306498        4.0     1.0\n",
       "424164   297789        0.0     1.0\n",
       "424165   395814        3.0     1.0\n",
       "424166   245950        0.0     1.0\n",
       "424167   208016        NaN     NaN\n",
       "424168   272535        6.0     1.0\n",
       "424169    18031        3.0     1.0"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>424160</th>\n",
       "      <td>97195</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424161</th>\n",
       "      <td>54826</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424162</th>\n",
       "      <td>156155</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424163</th>\n",
       "      <td>306498</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424164</th>\n",
       "      <td>297789</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424165</th>\n",
       "      <td>395814</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424166</th>\n",
       "      <td>245950</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424167</th>\n",
       "      <td>208016</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424168</th>\n",
       "      <td>272535</td>\n",
       "      <td>6.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424169</th>\n",
       "      <td>18031</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 58
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:29.348644Z",
     "start_time": "2025-05-14T00:11:29.236123Z"
    }
   },
   "cell_type": "code",
   "source": "user_info.describe()",
   "id": "6bc1b2ecdcf4b7c1",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "             user_id      age_range         gender\n",
       "count  424170.000000  421953.000000  417734.000000\n",
       "mean   212085.500000       2.930262       0.341179\n",
       "std    122447.476178       1.942978       0.524112\n",
       "min         1.000000       0.000000       0.000000\n",
       "25%    106043.250000       2.000000       0.000000\n",
       "50%    212085.500000       3.000000       0.000000\n",
       "75%    318127.750000       4.000000       1.000000\n",
       "max    424170.000000       8.000000       2.000000"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>424170.000000</td>\n",
       "      <td>421953.000000</td>\n",
       "      <td>417734.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>212085.500000</td>\n",
       "      <td>2.930262</td>\n",
       "      <td>0.341179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>122447.476178</td>\n",
       "      <td>1.942978</td>\n",
       "      <td>0.524112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>106043.250000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>212085.500000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>318127.750000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>424170.000000</td>\n",
       "      <td>8.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:31.927058Z",
     "start_time": "2025-05-14T00:11:31.903100Z"
    }
   },
   "cell_type": "code",
   "source": "user_info.info()",
   "id": "d749d679758c2efe",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 424170 entries, 0 to 424169\n",
      "Data columns (total 3 columns):\n",
      " #   Column     Non-Null Count   Dtype  \n",
      "---  ------     --------------   -----  \n",
      " 0   user_id    424170 non-null  int64  \n",
      " 1   age_range  421953 non-null  float64\n",
      " 2   gender     417734 non-null  float64\n",
      "dtypes: float64(2), int64(1)\n",
      "memory usage: 9.7 MB\n"
     ]
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:33.978174Z",
     "start_time": "2025-05-14T00:11:33.950500Z"
    }
   },
   "cell_type": "code",
   "source": "user_log.info()",
   "id": "dbdb466d29d6929c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 54925330 entries, 0 to 54925329\n",
      "Data columns (total 7 columns):\n",
      " #   Column       Dtype  \n",
      "---  ------       -----  \n",
      " 0   user_id      int64  \n",
      " 1   item_id      int64  \n",
      " 2   cat_id       int64  \n",
      " 3   seller_id    int64  \n",
      " 4   brand_id     float64\n",
      " 5   time_stamp   int64  \n",
      " 6   action_type  int64  \n",
      "dtypes: float64(1), int64(6)\n",
      "memory usage: 2.9 GB\n"
     ]
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:05:35.880329Z",
     "start_time": "2025-05-14T01:05:33.871897Z"
    }
   },
   "cell_type": "code",
   "source": "user_info.tail(10)",
   "id": "1c998e04d6faa258",
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'user_info' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mNameError\u001B[0m                                 Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[56], line 1\u001B[0m\n\u001B[1;32m----> 1\u001B[0m user_info\u001B[38;5;241m.\u001B[39mtail(\u001B[38;5;241m10\u001B[39m)\n",
      "\u001B[1;31mNameError\u001B[0m: name 'user_info' is not defined"
     ]
    }
   ],
   "execution_count": 56
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:36.894539Z",
     "start_time": "2025-05-14T00:11:35.918239Z"
    }
   },
   "cell_type": "code",
   "source": "user_log.isna().sum()",
   "id": "42cb3b5a225b915e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "user_id            0\n",
       "item_id            0\n",
       "cat_id             0\n",
       "seller_id          0\n",
       "brand_id       91015\n",
       "time_stamp         0\n",
       "action_type        0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:37.910561Z",
     "start_time": "2025-05-14T00:11:37.892276Z"
    }
   },
   "cell_type": "code",
   "source": "train_data.info()",
   "id": "3fcba98d3c2f6c34",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 260864 entries, 0 to 260863\n",
      "Data columns (total 3 columns):\n",
      " #   Column       Non-Null Count   Dtype\n",
      "---  ------       --------------   -----\n",
      " 0   user_id      260864 non-null  int64\n",
      " 1   merchant_id  260864 non-null  int64\n",
      " 2   label        260864 non-null  int64\n",
      "dtypes: int64(3)\n",
      "memory usage: 6.0 MB\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:40.002821Z",
     "start_time": "2025-05-14T00:11:39.986892Z"
    }
   },
   "cell_type": "code",
   "source": "train_data",
   "id": "89d868f37563ddbd",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id  label\n",
       "0         34176         3906      0\n",
       "1         34176          121      0\n",
       "2         34176         4356      1\n",
       "3         34176         2217      0\n",
       "4        230784         4818      0\n",
       "...         ...          ...    ...\n",
       "260859   359807         4325      0\n",
       "260860   294527         3971      0\n",
       "260861   294527          152      0\n",
       "260862   294527         2537      0\n",
       "260863   229247         4140      0\n",
       "\n",
       "[260864 rows x 3 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>260859</th>\n",
       "      <td>359807</td>\n",
       "      <td>4325</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>260860</th>\n",
       "      <td>294527</td>\n",
       "      <td>3971</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>260861</th>\n",
       "      <td>294527</td>\n",
       "      <td>152</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>260862</th>\n",
       "      <td>294527</td>\n",
       "      <td>2537</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>260863</th>\n",
       "      <td>229247</td>\n",
       "      <td>4140</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>260864 rows × 3 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 8
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:41.328556Z",
     "start_time": "2025-05-14T00:11:41.307817Z"
    }
   },
   "cell_type": "code",
   "source": "import seaborn as sns",
   "id": "ad78072c41a07d8e",
   "outputs": [],
   "execution_count": 9
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "",
   "id": "3f26c28d849e3b97"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:46.788287Z",
     "start_time": "2025-05-14T00:11:45.239245Z"
    }
   },
   "cell_type": "code",
   "source": [
    "label_gp = train_data.groupby('label')['user_id'].count()\n",
    "print('正负样本的数量： \\n',label_gp)\n",
    "\n",
    "_,axe = plt.subplots(1,2,figsize=(12,6))\n",
    "train_data.label.value_counts().plot(kind='pie',autopct='%1.1f%%',shadow = True,explode = [0,0.1],ax= axe[0])\n",
    "sns.countplot(x='label',data=train_data,ax=axe[1],)"
   ],
   "id": "317726c42cf2f9c0",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "正负样本的数量： \n",
      " label\n",
      "0    244912\n",
      "1     15952\n",
      "Name: user_id, dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='label', ylabel='count'>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 1200x600 with 2 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA8cAAAIJCAYAAACImk8qAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAhfBJREFUeJzs3Xl8VfWd//HXvTf7vhICJGxJWBKBECCyqiyiUhEBl4q2arWttJ3aGe201f7akaJ2OuOo05EZW5VabVVQFBQVXJAdAoRAAtnJvu97crffH4HUCMoWcpN738/H4z4053vOuZ+DmHPf9/s936/BbrfbEREREREREXFhRkcXICIiIiIiIuJoCsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLUzgWERERERERl6dwLCIiIiIiIi5P4VhERERERERcnsKxiIiIiIiIuDyFYxEREREREXF5CsciIiIiIiLi8twcXYCIiIg4n9raZux2R1chIiICBgOEhvqfdz+FYxEREelzdjsKxyIiMqhoWLWIiIiIiIi4PIVjERERERERcXkKxyIiIiIiIuLyFI5FRERERETE5Skci4iIiIiIiMtTOBYREXGAzMxM7rvvPmbMmMHs2bP5+c9/Tl1dHQC/+c1vSEhIIDExsef15ptv9hy7adMmFi1axJQpU1i+fDmpqak9bVarld///vfMmjWLxMREHnroIaqqqnraa2trWb16NdOmTSM5OZm1a9disVh62tPS0rjttttITExk/vz5bNiwoR/+NERERBxP4VhERKSfdXR08MADD5CYmMju3bt5//33aWho4Fe/+hUAx48fZ82aNaSmpva87rjjDgAOHDjAmjVrePrpp0lJSWHp0qU89NBDtLe3A7Bu3Tr27NnD22+/za5du/Dy8uLxxx/vee+HH34YHx8fdu3axcaNG9m3bx/r168HoLGxke9///ssW7aMlJQU1q5dy1NPPcWxY8f69w9IRETEARSORURE+llZWRnjx4/nRz/6ER4eHgQHB3PHHXeQkpJCV1cX2dnZJCQknPPYDRs2sGTJEpKSknB3d+fee+8lODiYrVu39rQ/+OCDREZG4ufnx2OPPcbOnTspLi6msLCQgwcP8uijj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XL7/oa6ypUc+xiIgMDAYDhIWdv+dY4VhERET6nMKxiIgMFBcajjWsWkRERERERFyewrGIiIiIiIi4PIVjERERERERcXlayklEREQGPKPRgNFoOP+OIg5is9mx2fSgvchgpnAsIiIiA5rRaCAoyAeTSQPeZOCyWm00NLQpIIsMYgrHIiIiMqAZjQZMJiOP/20Xp6oaHV2OyFlGDwnkd3fNxWg0KByLDGIKxyIiIjIonKpqJLO0ztFliIiIk9L4JBEREREREXF5CsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLUzgWERERERERl6dwLCIiIiIiIi5P4VhERERERERcnsKxiIiIiIiIuDyFYxEREREREXF5CsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLUzgWERERERERl6dwLCIiIiIiIi5P4VhERERERERcnsKxiIiIiIiIuDyFYxEREREREXF5CsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLUzgWERERERERl6dwLCIiIiIiIi5P4VhERERERERcnsKxiIiIiIiIuDyFYxEREREREXF5CsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLUzgWERERERERl6dwLCIiIiIiIi5P4VhERERERERcnsKxiIiIiIiIuDyFYxEREREREXF5CsciIiIiIiLi8hSORURERERExOUpHIuIiIiIiIjLc3N0ASLyD3a7HavNjt0ORqMBw5ntZ+8JGLCfaTl7h+5NdjAawWTU92AiIiIiIt9E4VjkCrOdDrwAJqMBo8HQq91itVHfZqampZPKpg6qmzupaemktrWLLosNg6E7JBsM9IRlw+lzdG8z9LR9+Wd3k5EgH3dCfT0I9fMk3N+TEF8PgrzdcTP1Dstmqw0AN6Oh59wiIiIiIq5E4Vikj1htNux2eoJna6eFvOoWyhs7qGnupKa1q/ufp4PvmX9v6rD0e61+nm4M8fdkaKAXkYFeRAZ5MyzQi2FB3owI9mFooBd+nt2/HixWGwaDep9FRERExLkpHItcArPFhsnU3Qtss9sprW8nvbSRE+VNnCxvIrOimZL6dkeX+bVaOi20dFrIr2n92n3C/T2JHxZA/LBAEoYFM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jAcwK4hgAoCBefvnlTE5O5uabb86aNWty/fXXp6+vr9FjAcwKpVqtVmv0EAAAANBIjhwDAABQeOIYAACAwhPHAAAAFJ44BgAAoPDEMQAAAIUnjgEAACg8cQwAAEDhiWMAADiNdu/encsuuyy7d+/+P7fbsmVLLrvssr/8POvXr88rr7zyl38eik4cAwAAUHjiGAAAZsg333yTe++9N9ddd12uvPLKrF69Otu2bTtpm1dffTUrV67MDTfckBdffDETExP1+z755JPccccdWb58eVavXp2vvvpqhvcAzl7iGAAAZsD4+Hgeeuih3Hrrrfnyyy+zZcuWLF68OC+88MJJ2/3www/59NNP89Zbb+Wzzz7La6+9liT54osv8tRTT+XJJ5/M1q1b8/DDD+fhhx/O9u3bG7E7cNYRxwAAMANaWlry/vvvZ+3atZmYmMiePXvS29ubffv21bcplUp58skn09nZmYsuuij3339/PvrooyTJ22+/nXvuuSdXX311mpqacuONN+amm27Ke++916hdgrNKc6MHAACAIiiXy9m8eXMeeOCBVKvVXHLJJWlubk6tVqtv09PTk56envryeeedV4/nPXv2ZOvWrXn33Xfr909NTeWaa66ZuZ2As5g4BgCAGTA0NJRnnnkm7733Xq644ookyRtvvJGdO3fWtxkZGUm1Wk2lUkmS9Pf354ILLkiSLFy4MKtWrcqDDz5Y335gYCDt7e0zuBdw9vKxagAAmAHff/99yuVyPWa3bduWjRs3nnTCrampqTz//POpVqvZsWNHXn/99dx9991JkjVr1mTjxo359ttvkyTfffddVq9enY8//njmdwbOQo4cAwDADLj22muzdu3arFu3LtPT07nwwguzfv36vPTSSxkcHEyS9Pb2pre3NytXrkxnZ2fuvvvurFu3Lkly2223pVqt5oknnsjAwEB6e3tz3333Zf369Y3cLThrlGq//ZIDAAAAFJCPVQMAAFB44hgAAIDCE8cAAAAUnjgGAACg8MQxAAAAhSeOAQAAKDxxDAAAQOGJYwAAAApPHAMAAFB44hgAAIDCE8cAAAAUnjgGAACg8P4b18Q9GhMN97EAAAAASUVORK5CYII="
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 10
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:48.315287Z",
     "start_time": "2025-05-14T00:11:48.300071Z"
    }
   },
   "cell_type": "code",
   "source": [
    "train_data['origin']='train'\n",
    "test_data['origin']='test'"
   ],
   "id": "314a861049ef57f2",
   "outputs": [],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:49.697481Z",
     "start_time": "2025-05-14T00:11:49.632535Z"
    }
   },
   "cell_type": "code",
   "source": [
    "data_all=pd.concat([train_data,test_data],ignore_index=True,sort=False)\n",
    "data_all.drop('prob',axis=1,inplace=True)\n",
    "data_all"
   ],
   "id": "f7ce7ea8d95544fd",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id  label origin\n",
       "0         34176         3906    0.0  train\n",
       "1         34176          121    0.0  train\n",
       "2         34176         4356    1.0  train\n",
       "3         34176         2217    0.0  train\n",
       "4        230784         4818    0.0  train\n",
       "...         ...          ...    ...    ...\n",
       "522336   228479         3111    NaN   test\n",
       "522337    97919         2341    NaN   test\n",
       "522338    97919         3971    NaN   test\n",
       "522339    32639         3536    NaN   test\n",
       "522340    32639         3319    NaN   test\n",
       "\n",
       "[522341 rows x 4 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>NaN</td>\n",
       "      <td>test</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>NaN</td>\n",
       "      <td>test</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>NaN</td>\n",
       "      <td>test</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>NaN</td>\n",
       "      <td>test</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>NaN</td>\n",
       "      <td>test</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>522341 rows × 4 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:54.301123Z",
     "start_time": "2025-05-14T00:11:54.278847Z"
    }
   },
   "cell_type": "code",
   "source": "user_info",
   "id": "160ca37896ef503e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  age_range  gender\n",
       "0        376517        6.0     1.0\n",
       "1        234512        5.0     0.0\n",
       "2        344532        5.0     0.0\n",
       "3        186135        5.0     0.0\n",
       "4         30230        5.0     0.0\n",
       "...         ...        ...     ...\n",
       "424165   395814        3.0     1.0\n",
       "424166   245950        0.0     1.0\n",
       "424167   208016        NaN     NaN\n",
       "424168   272535        6.0     1.0\n",
       "424169    18031        3.0     1.0\n",
       "\n",
       "[424170 rows x 3 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>376517</td>\n",
       "      <td>6.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>234512</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>344532</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>186135</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>30230</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424165</th>\n",
       "      <td>395814</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424166</th>\n",
       "      <td>245950</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424167</th>\n",
       "      <td>208016</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424168</th>\n",
       "      <td>272535</td>\n",
       "      <td>6.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424169</th>\n",
       "      <td>18031</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>424170 rows × 3 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:56.491356Z",
     "start_time": "2025-05-14T00:11:56.307969Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 连接user_info表，通过user_id关联\n",
    "all_data = data_all.merge(user_info, on='user_id', how='left')\n",
    "display(all_data.shape,all_data.head())"
   ],
   "id": "57092bdd357242d5",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(522341, 6)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "   user_id  merchant_id  label origin  age_range  gender\n",
       "0    34176         3906    0.0  train        6.0     0.0\n",
       "1    34176          121    0.0  train        6.0     0.0\n",
       "2    34176         4356    1.0  train        6.0     0.0\n",
       "3    34176         2217    0.0  train        6.0     0.0\n",
       "4   230784         4818    0.0  train        0.0     0.0"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 14
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:11:57.796235Z",
     "start_time": "2025-05-14T00:11:57.787317Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 使用 merchant_id（原列名seller_id）\n",
    "user_log.rename(columns={'seller_id':'merchant_id'}, inplace=True)"
   ],
   "id": "35db1ee62a096684",
   "outputs": [],
   "execution_count": 15
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:00.020766Z",
     "start_time": "2025-05-14T00:11:59.988908Z"
    }
   },
   "cell_type": "code",
   "source": "user_log",
   "id": "745ee97279632674",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "          user_id  item_id  cat_id  merchant_id  brand_id  time_stamp  \\\n",
       "0          328862   323294     833         2882    2661.0         829   \n",
       "1          328862   844400    1271         2882    2661.0         829   \n",
       "2          328862   575153    1271         2882    2661.0         829   \n",
       "3          328862   996875    1271         2882    2661.0         829   \n",
       "4          328862  1086186    1271         1253    1049.0         829   \n",
       "...           ...      ...     ...          ...       ...         ...   \n",
       "54925325   208016   107662     898         1346    7995.0        1110   \n",
       "54925326   208016  1058313     898         1346    7995.0        1110   \n",
       "54925327   208016   449814     898          983    7995.0        1110   \n",
       "54925328   208016   634856     898         1346    7995.0        1110   \n",
       "54925329   208016   272094     898         1346    7995.0        1111   \n",
       "\n",
       "          action_type  \n",
       "0                   0  \n",
       "1                   0  \n",
       "2                   0  \n",
       "3                   0  \n",
       "4                   0  \n",
       "...               ...  \n",
       "54925325            0  \n",
       "54925326            0  \n",
       "54925327            0  \n",
       "54925328            0  \n",
       "54925329            0  \n",
       "\n",
       "[54925330 rows x 7 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>item_id</th>\n",
       "      <th>cat_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>brand_id</th>\n",
       "      <th>time_stamp</th>\n",
       "      <th>action_type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>328862</td>\n",
       "      <td>323294</td>\n",
       "      <td>833</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661.0</td>\n",
       "      <td>829</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>328862</td>\n",
       "      <td>844400</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661.0</td>\n",
       "      <td>829</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>328862</td>\n",
       "      <td>575153</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661.0</td>\n",
       "      <td>829</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>328862</td>\n",
       "      <td>996875</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661.0</td>\n",
       "      <td>829</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>328862</td>\n",
       "      <td>1086186</td>\n",
       "      <td>1271</td>\n",
       "      <td>1253</td>\n",
       "      <td>1049.0</td>\n",
       "      <td>829</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925325</th>\n",
       "      <td>208016</td>\n",
       "      <td>107662</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995.0</td>\n",
       "      <td>1110</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925326</th>\n",
       "      <td>208016</td>\n",
       "      <td>1058313</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995.0</td>\n",
       "      <td>1110</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925327</th>\n",
       "      <td>208016</td>\n",
       "      <td>449814</td>\n",
       "      <td>898</td>\n",
       "      <td>983</td>\n",
       "      <td>7995.0</td>\n",
       "      <td>1110</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925328</th>\n",
       "      <td>208016</td>\n",
       "      <td>634856</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995.0</td>\n",
       "      <td>1110</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925329</th>\n",
       "      <td>208016</td>\n",
       "      <td>272094</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995.0</td>\n",
       "      <td>1111</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54925330 rows × 7 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 16
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:33.413277Z",
     "start_time": "2025-05-14T00:12:33.297273Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 手动释放内存 清除不用的引用对象\n",
    "import gc\n",
    "del train_data,test_data,user_info\n",
    "gc.collect()"
   ],
   "id": "18073d3709ce2a2",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "146"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 17
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:36.114515Z",
     "start_time": "2025-05-14T00:12:36.095817Z"
    }
   },
   "cell_type": "code",
   "source": [
    "%%time\n",
    "display(user_log.info())"
   ],
   "id": "81f3bf9419b15e7",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 54925330 entries, 0 to 54925329\n",
      "Data columns (total 7 columns):\n",
      " #   Column       Dtype  \n",
      "---  ------       -----  \n",
      " 0   user_id      int64  \n",
      " 1   item_id      int64  \n",
      " 2   cat_id       int64  \n",
      " 3   merchant_id  int64  \n",
      " 4   brand_id     float64\n",
      " 5   time_stamp   int64  \n",
      " 6   action_type  int64  \n",
      "dtypes: float64(1), int64(6)\n",
      "memory usage: 2.9 GB\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "None"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: total: 15.6 ms\n",
      "Wall time: 15.3 ms\n"
     ]
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:39.236439Z",
     "start_time": "2025-05-14T00:12:39.176245Z"
    }
   },
   "cell_type": "code",
   "source": "display(all_data.isnull().sum())",
   "id": "e5b0bc74f7943af",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "user_id             0\n",
       "merchant_id         0\n",
       "label          261477\n",
       "origin              0\n",
       "age_range        2578\n",
       "gender           7545\n",
       "dtype: int64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 19
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:44.554949Z",
     "start_time": "2025-05-14T00:12:41.007757Z"
    }
   },
   "cell_type": "code",
   "source": [
    "%%time\n",
    "# 用户行为数据类型转换  压缩数据\n",
    "user_log['user_id'] = user_log['user_id'].astype('int32')\n",
    "user_log['merchant_id'] = user_log['merchant_id'].astype('int32')\n",
    "user_log['item_id'] = user_log['item_id'].astype('int32')\n",
    "user_log['cat_id'] = user_log['cat_id'].astype('int32')\n",
    "user_log['brand_id'].fillna(0, inplace=True)\n",
    "user_log['brand_id'] = user_log['brand_id'].astype('int32')\n",
    "user_log['time_stamp'] = pd.to_datetime(user_log['time_stamp'], format='%H%M')\n",
    "user_log['action_type'] = user_log['action_type'].astype('int32')\n",
    "display(user_log.info(),user_log.head())"
   ],
   "id": "12f4bdfb68f0f954",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 54925330 entries, 0 to 54925329\n",
      "Data columns (total 7 columns):\n",
      " #   Column       Dtype         \n",
      "---  ------       -----         \n",
      " 0   user_id      int32         \n",
      " 1   item_id      int32         \n",
      " 2   cat_id       int32         \n",
      " 3   merchant_id  int32         \n",
      " 4   brand_id     int32         \n",
      " 5   time_stamp   datetime64[ns]\n",
      " 6   action_type  int32         \n",
      "dtypes: datetime64[ns](1), int32(6)\n",
      "memory usage: 1.6 GB\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "None"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "   user_id  item_id  cat_id  merchant_id  brand_id          time_stamp  \\\n",
       "0   328862   323294     833         2882      2661 1900-01-01 08:29:00   \n",
       "1   328862   844400    1271         2882      2661 1900-01-01 08:29:00   \n",
       "2   328862   575153    1271         2882      2661 1900-01-01 08:29:00   \n",
       "3   328862   996875    1271         2882      2661 1900-01-01 08:29:00   \n",
       "4   328862  1086186    1271         1253      1049 1900-01-01 08:29:00   \n",
       "\n",
       "   action_type  \n",
       "0            0  \n",
       "1            0  \n",
       "2            0  \n",
       "3            0  \n",
       "4            0  "
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>item_id</th>\n",
       "      <th>cat_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>brand_id</th>\n",
       "      <th>time_stamp</th>\n",
       "      <th>action_type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>328862</td>\n",
       "      <td>323294</td>\n",
       "      <td>833</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>328862</td>\n",
       "      <td>844400</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>328862</td>\n",
       "      <td>575153</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>328862</td>\n",
       "      <td>996875</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>328862</td>\n",
       "      <td>1086186</td>\n",
       "      <td>1271</td>\n",
       "      <td>1253</td>\n",
       "      <td>1049</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: total: 3.5 s\n",
      "Wall time: 3.54 s\n"
     ]
    }
   ],
   "execution_count": 20
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:49.664193Z",
     "start_time": "2025-05-14T00:12:49.598381Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 缺失值填充\n",
    "all_data['age_range'].fillna(0, inplace=True)\n",
    "all_data['gender'].fillna(2, inplace=True)\n",
    "all_data.isnull().sum()"
   ],
   "id": "7009b0566ce9439",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "user_id             0\n",
       "merchant_id         0\n",
       "label          261477\n",
       "origin              0\n",
       "age_range           0\n",
       "gender              0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 21
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:52.325818Z",
     "start_time": "2025-05-14T00:12:52.262203Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.info()",
   "id": "abfeb8ff611d4078",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 522341 entries, 0 to 522340\n",
      "Data columns (total 6 columns):\n",
      " #   Column       Non-Null Count   Dtype  \n",
      "---  ------       --------------   -----  \n",
      " 0   user_id      522341 non-null  int64  \n",
      " 1   merchant_id  522341 non-null  int64  \n",
      " 2   label        260864 non-null  float64\n",
      " 3   origin       522341 non-null  object \n",
      " 4   age_range    522341 non-null  float64\n",
      " 5   gender       522341 non-null  float64\n",
      "dtypes: float64(3), int64(2), object(1)\n",
      "memory usage: 23.9+ MB\n"
     ]
    }
   ],
   "execution_count": 22
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:12:56.237254Z",
     "start_time": "2025-05-14T00:12:55.434318Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 数据类型转换 压缩\n",
    "all_data['age_range'] = all_data['age_range'].astype('int8')\n",
    "all_data['gender'] = all_data['gender'].astype('int8')\n",
    "all_data['label'] = all_data['label'].astype('str')\n",
    "all_data['user_id'] = all_data['user_id'].astype('int32')\n",
    "all_data['merchant_id'] = all_data['merchant_id'].astype('int32')\n",
    "all_data.info()"
   ],
   "id": "bcc5277b171a923c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 522341 entries, 0 to 522340\n",
      "Data columns (total 6 columns):\n",
      " #   Column       Non-Null Count   Dtype \n",
      "---  ------       --------------   ----- \n",
      " 0   user_id      522341 non-null  int32 \n",
      " 1   merchant_id  522341 non-null  int32 \n",
      " 2   label        522341 non-null  object\n",
      " 3   origin       522341 non-null  object\n",
      " 4   age_range    522341 non-null  int8  \n",
      " 5   gender       522341 non-null  int8  \n",
      "dtypes: int32(2), int8(2), object(2)\n",
      "memory usage: 13.0+ MB\n"
     ]
    }
   ],
   "execution_count": 23
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:13:12.123446Z",
     "start_time": "2025-05-14T00:13:12.101265Z"
    }
   },
   "cell_type": "code",
   "source": "user_log",
   "id": "82a56276ae1ed542",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "          user_id  item_id  cat_id  merchant_id  brand_id          time_stamp  \\\n",
       "0          328862   323294     833         2882      2661 1900-01-01 08:29:00   \n",
       "1          328862   844400    1271         2882      2661 1900-01-01 08:29:00   \n",
       "2          328862   575153    1271         2882      2661 1900-01-01 08:29:00   \n",
       "3          328862   996875    1271         2882      2661 1900-01-01 08:29:00   \n",
       "4          328862  1086186    1271         1253      1049 1900-01-01 08:29:00   \n",
       "...           ...      ...     ...          ...       ...                 ...   \n",
       "54925325   208016   107662     898         1346      7995 1900-01-01 11:10:00   \n",
       "54925326   208016  1058313     898         1346      7995 1900-01-01 11:10:00   \n",
       "54925327   208016   449814     898          983      7995 1900-01-01 11:10:00   \n",
       "54925328   208016   634856     898         1346      7995 1900-01-01 11:10:00   \n",
       "54925329   208016   272094     898         1346      7995 1900-01-01 11:11:00   \n",
       "\n",
       "          action_type  \n",
       "0                   0  \n",
       "1                   0  \n",
       "2                   0  \n",
       "3                   0  \n",
       "4                   0  \n",
       "...               ...  \n",
       "54925325            0  \n",
       "54925326            0  \n",
       "54925327            0  \n",
       "54925328            0  \n",
       "54925329            0  \n",
       "\n",
       "[54925330 rows x 7 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>item_id</th>\n",
       "      <th>cat_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>brand_id</th>\n",
       "      <th>time_stamp</th>\n",
       "      <th>action_type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>328862</td>\n",
       "      <td>323294</td>\n",
       "      <td>833</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>328862</td>\n",
       "      <td>844400</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>328862</td>\n",
       "      <td>575153</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>328862</td>\n",
       "      <td>996875</td>\n",
       "      <td>1271</td>\n",
       "      <td>2882</td>\n",
       "      <td>2661</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>328862</td>\n",
       "      <td>1086186</td>\n",
       "      <td>1271</td>\n",
       "      <td>1253</td>\n",
       "      <td>1049</td>\n",
       "      <td>1900-01-01 08:29:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925325</th>\n",
       "      <td>208016</td>\n",
       "      <td>107662</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995</td>\n",
       "      <td>1900-01-01 11:10:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925326</th>\n",
       "      <td>208016</td>\n",
       "      <td>1058313</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995</td>\n",
       "      <td>1900-01-01 11:10:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925327</th>\n",
       "      <td>208016</td>\n",
       "      <td>449814</td>\n",
       "      <td>898</td>\n",
       "      <td>983</td>\n",
       "      <td>7995</td>\n",
       "      <td>1900-01-01 11:10:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925328</th>\n",
       "      <td>208016</td>\n",
       "      <td>634856</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995</td>\n",
       "      <td>1900-01-01 11:10:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54925329</th>\n",
       "      <td>208016</td>\n",
       "      <td>272094</td>\n",
       "      <td>898</td>\n",
       "      <td>1346</td>\n",
       "      <td>7995</td>\n",
       "      <td>1900-01-01 11:11:00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54925330 rows × 7 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 24
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:13:40.103292Z",
     "start_time": "2025-05-14T00:13:40.089545Z"
    }
   },
   "cell_type": "code",
   "source": [
    "%%time\n",
    "##### 特征处理\n",
    "##### User特征处理\n",
    "groups = user_log.groupby(['user_id'])\n",
    "groups"
   ],
   "id": "4c0d77d874dd1efe",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: total: 0 ns\n",
      "Wall time: 0 ns\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<pandas.core.groupby.generic.DataFrameGroupBy object at 0x0000029F009860C0>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 25
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:14:34.674677Z",
     "start_time": "2025-05-14T00:14:33.952979Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 用户交互行为数量 u1\n",
    "temp = groups.size().reset_index().rename(columns={0:'u1'})\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n",
    "all_data\n"
   ],
   "id": "556a46335c50e020",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y\n",
       "0         34176         3906   0.0  train          6       0   451   451\n",
       "1         34176          121   0.0  train          6       0   451   451\n",
       "2         34176         4356   1.0  train          6       0   451   451\n",
       "3         34176         2217   0.0  train          6       0   451   451\n",
       "4        230784         4818   0.0  train          0       0    54    54\n",
       "...         ...          ...   ...    ...        ...     ...   ...   ...\n",
       "522336   228479         3111   nan   test          6       0  2004  2004\n",
       "522337    97919         2341   nan   test          8       1    55    55\n",
       "522338    97919         3971   nan   test          8       1    55    55\n",
       "522339    32639         3536   nan   test          0       0    72    72\n",
       "522340    32639         3319   nan   test          0       0    72    72\n",
       "\n",
       "[522341 rows x 8 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>522341 rows × 8 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 27
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:14:53.724648Z",
     "start_time": "2025-05-14T00:14:38.432798Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 细分\n",
    "# 使用 agg 基于列的聚合操作，统计唯一值个数 item_id, cat_id, merchant_id, brand_id\n",
    "# 用户，交互行为：点了多少商品呢？\n",
    "temp = groups['item_id'].agg([('u2', 'nunique')]).reset_index()\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n",
    " "
   ],
   "id": "c2e423cb49a3938c",
   "outputs": [],
   "execution_count": 28
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:22:37.429400Z",
     "start_time": "2025-05-14T00:22:31.771841Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 用户，交互行为，具体统计：类目多少\n",
    "temp = groups['cat_id'].agg([('u3', 'nunique')]).reset_index()\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n",
    " "
   ],
   "id": "f098c737f58971fc",
   "outputs": [],
   "execution_count": 29
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:22:48.513315Z",
     "start_time": "2025-05-14T00:22:40.425076Z"
    }
   },
   "cell_type": "code",
   "source": [
    "temp = groups['merchant_id'].agg([('u4', 'nunique')]).reset_index()\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n",
    " "
   ],
   "id": "3469543e25249112",
   "outputs": [],
   "execution_count": 30
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:23:00.197068Z",
     "start_time": "2025-05-14T00:22:52.284055Z"
    }
   },
   "cell_type": "code",
   "source": [
    "temp = groups['brand_id'].agg([('u5', 'nunique')]).reset_index()\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n"
   ],
   "id": "4de32f0be325019",
   "outputs": [],
   "execution_count": 31
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:23:03.365737Z",
     "start_time": "2025-05-14T00:23:01.853941Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 购物时间间隔特征 u6 按照小时\n",
    "temp = groups['time_stamp'].agg([('F_time', 'min'), ('B_time', 'max')]).reset_index()\n",
    "temp['u6'] = (temp['B_time'] - temp['F_time']).dt.seconds/3600\n",
    "all_data = all_data.merge(temp[['user_id', 'u6']], on='user_id', how='left')\n"
   ],
   "id": "2f747271d195fd24",
   "outputs": [],
   "execution_count": 32
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:23:10.379002Z",
     "start_time": "2025-05-14T00:23:04.959047Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 统计操作类型为0，1，2，3的个数\n",
    "temp = groups['action_type'].value_counts().unstack().reset_index().rename(\n",
    "    columns={0:'u7', 1:'u8', 2:'u9', 3:'u10'})\n",
    "all_data = all_data.merge(temp, on='user_id', how='left')\n"
   ],
   "id": "dd514388f7353ebe",
   "outputs": [],
   "execution_count": 33
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:23:14.341258Z",
     "start_time": "2025-05-14T00:23:13.992847Z"
    }
   },
   "cell_type": "code",
   "source": [
    "del temp,groups\n",
    "gc.collect()"
   ],
   "id": "962b6bbde4513f7e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 34
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:23:17.410659Z",
     "start_time": "2025-05-14T00:23:17.381028Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.head()",
   "id": "43821c78ef678f77",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   user_id  merchant_id label origin  age_range  gender  u1_x  u1_y   u2  u3  \\\n",
       "0    34176         3906   0.0  train          6       0   451   451  256  45   \n",
       "1    34176          121   0.0  train          6       0   451   451  256  45   \n",
       "2    34176         4356   1.0  train          6       0   451   451  256  45   \n",
       "3    34176         2217   0.0  train          6       0   451   451  256  45   \n",
       "4   230784         4818   0.0  train          0       0    54    54   31  17   \n",
       "\n",
       "    u4   u5        u6     u7  u8    u9  u10  \n",
       "0  109  108  5.833333  410.0 NaN  34.0  7.0  \n",
       "1  109  108  5.833333  410.0 NaN  34.0  7.0  \n",
       "2  109  108  5.833333  410.0 NaN  34.0  7.0  \n",
       "3  109  108  5.833333  410.0 NaN  34.0  7.0  \n",
       "4   20   19  5.166667   47.0 NaN   7.0  NaN  "
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>u4</th>\n",
       "      <th>u5</th>\n",
       "      <th>u6</th>\n",
       "      <th>u7</th>\n",
       "      <th>u8</th>\n",
       "      <th>u9</th>\n",
       "      <th>u10</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>109</td>\n",
       "      <td>108</td>\n",
       "      <td>5.833333</td>\n",
       "      <td>410.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>109</td>\n",
       "      <td>108</td>\n",
       "      <td>5.833333</td>\n",
       "      <td>410.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>109</td>\n",
       "      <td>108</td>\n",
       "      <td>5.833333</td>\n",
       "      <td>410.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>109</td>\n",
       "      <td>108</td>\n",
       "      <td>5.833333</td>\n",
       "      <td>410.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>31</td>\n",
       "      <td>17</td>\n",
       "      <td>20</td>\n",
       "      <td>19</td>\n",
       "      <td>5.166667</td>\n",
       "      <td>47.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 35
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "店铺特征工程",
   "id": "3c8526f4b92b9ed8"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:24:41.886491Z",
     "start_time": "2025-05-14T00:24:17.568822Z"
    }
   },
   "cell_type": "code",
   "source": [
    "##### 商家特征处理\n",
    "groups = user_log.groupby(['merchant_id'])\n",
    " \n",
    "# 商家被交互行为数量 m1\n",
    "temp = groups.size().reset_index().rename(columns={0:'m1'})\n",
    "all_data = all_data.merge(temp, on='merchant_id', how='left')\n",
    " \n",
    "# 统计商家被交互的 user_id, item_id, cat_id, brand_id 唯一值\n",
    "temp = groups[['user_id', 'item_id', 'cat_id', 'brand_id']].nunique().reset_index().rename(\n",
    "    columns={\n",
    "    'user_id':'m2',\n",
    "    'item_id':'m3', \n",
    "    'cat_id':'m4', \n",
    "    'brand_id':'m5'})\n",
    "all_data = all_data.merge(temp, on='merchant_id', how='left')\n",
    "\n",
    "# 统计商家被交互的 action_type 唯一值\n",
    "temp = groups['action_type'].value_counts().unstack().reset_index().rename(  \n",
    "    columns={0:'m6', 1:'m7', 2:'m8', 3:'m9'})\n",
    "all_data = all_data.merge(temp, on='merchant_id', how='left')\n",
    "\n",
    "del temp\n",
    "gc.collect()"
   ],
   "id": "9b090d3108e7d63",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 36
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:24:45.452520Z",
     "start_time": "2025-05-14T00:24:45.418209Z"
    }
   },
   "cell_type": "code",
   "source": "display(all_data.tail())",
   "id": "e17fa9aab6226301",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...    u10     m1    m2   m3   m4  m5       m6    m7  \\\n",
       "522336  1173  71  ...  208.0  10105  4154  542   50  18   8997.0   9.0   \n",
       "522337    29  14  ...    1.0   5543  1592  352   93  19   4548.0   6.0   \n",
       "522338    29  14  ...    1.0  28892  7587  272    7   2  24602.0  94.0   \n",
       "522339    46  24  ...    1.0  14027  4956  322   19   3  12807.0  29.0   \n",
       "522340    46  24  ...    1.0  25959  7927  952  175  85  21737.0  34.0   \n",
       "\n",
       "            m8      m9  \n",
       "522336   687.0   412.0  \n",
       "522337   815.0   174.0  \n",
       "522338  2608.0  1588.0  \n",
       "522339   793.0   398.0  \n",
       "522340  2700.0  1488.0  \n",
       "\n",
       "[5 rows x 26 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>u10</th>\n",
       "      <th>m1</th>\n",
       "      <th>m2</th>\n",
       "      <th>m3</th>\n",
       "      <th>m4</th>\n",
       "      <th>m5</th>\n",
       "      <th>m6</th>\n",
       "      <th>m7</th>\n",
       "      <th>m8</th>\n",
       "      <th>m9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10105</td>\n",
       "      <td>4154</td>\n",
       "      <td>542</td>\n",
       "      <td>50</td>\n",
       "      <td>18</td>\n",
       "      <td>8997.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>687.0</td>\n",
       "      <td>412.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5543</td>\n",
       "      <td>1592</td>\n",
       "      <td>352</td>\n",
       "      <td>93</td>\n",
       "      <td>19</td>\n",
       "      <td>4548.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>815.0</td>\n",
       "      <td>174.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>28892</td>\n",
       "      <td>7587</td>\n",
       "      <td>272</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>24602.0</td>\n",
       "      <td>94.0</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>1588.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14027</td>\n",
       "      <td>4956</td>\n",
       "      <td>322</td>\n",
       "      <td>19</td>\n",
       "      <td>3</td>\n",
       "      <td>12807.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>793.0</td>\n",
       "      <td>398.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>25959</td>\n",
       "      <td>7927</td>\n",
       "      <td>952</td>\n",
       "      <td>175</td>\n",
       "      <td>85</td>\n",
       "      <td>21737.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>2700.0</td>\n",
       "      <td>1488.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 37
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "1.8  用户和店铺联合特征工程(4min)",
   "id": "805009fe6685bab9"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:24:58.117700Z",
     "start_time": "2025-05-14T00:24:58.003294Z"
    }
   },
   "cell_type": "code",
   "source": [
    "##### 用户+商户特征\n",
    "groups = user_log.groupby(['user_id', 'merchant_id'])\n"
   ],
   "id": "42d544cd63548590",
   "outputs": [],
   "execution_count": 38
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:34:16.792143Z",
     "start_time": "2025-05-14T00:33:55.053995Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 用户在不同商家交互统计\n",
    "temp = groups.size().reset_index().rename(columns={0:'um1'})\n",
    "all_data = all_data.merge(temp, on=['user_id', 'merchant_id'], how='left')\n"
   ],
   "id": "15052993eeeb3f56",
   "outputs": [],
   "execution_count": 39
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:35:52.642013Z",
     "start_time": "2025-05-14T00:35:52.602565Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.tail(10)",
   "id": "fb236f558e74ba70",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522331   161663         1097   nan   test          0       0    36    36   \n",
       "522332   292991         3236   nan   test          2       0     9     9   \n",
       "522333   293759         4954   nan   test          3       1    77    77   \n",
       "522334   293759         2108   nan   test          3       1    77    77   \n",
       "522335   228479         3473   nan   test          6       0  2004  2004   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...     m1    m2   m3   m4  m5       m6    m7      m8  \\\n",
       "522331    27  12  ...   1309   670   96   16  12   1127.0   2.0   141.0   \n",
       "522332     5   3  ...  21858  6105   88    1   2  18342.0  50.0  1262.0   \n",
       "522333    48  25  ...   4165  1476  158    9   2   3674.0   7.0   163.0   \n",
       "522334    48  25  ...  15287  4715  186   13   2  12731.0  66.0  1769.0   \n",
       "522335  1173  71  ...  27369  8238  399    6   2  24746.0  38.0   658.0   \n",
       "522336  1173  71  ...  10105  4154  542   50  18   8997.0   9.0   687.0   \n",
       "522337    29  14  ...   5543  1592  352   93  19   4548.0   6.0   815.0   \n",
       "522338    29  14  ...  28892  7587  272    7   2  24602.0  94.0  2608.0   \n",
       "522339    46  24  ...  14027  4956  322   19   3  12807.0  29.0   793.0   \n",
       "522340    46  24  ...  25959  7927  952  175  85  21737.0  34.0  2700.0   \n",
       "\n",
       "            m9  um1  \n",
       "522331    39.0    2  \n",
       "522332  2204.0    6  \n",
       "522333   321.0    2  \n",
       "522334   721.0    4  \n",
       "522335  1927.0   42  \n",
       "522336   412.0    5  \n",
       "522337   174.0    2  \n",
       "522338  1588.0   16  \n",
       "522339   398.0    3  \n",
       "522340  1488.0   11  \n",
       "\n",
       "[10 rows x 27 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>m1</th>\n",
       "      <th>m2</th>\n",
       "      <th>m3</th>\n",
       "      <th>m4</th>\n",
       "      <th>m5</th>\n",
       "      <th>m6</th>\n",
       "      <th>m7</th>\n",
       "      <th>m8</th>\n",
       "      <th>m9</th>\n",
       "      <th>um1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522331</th>\n",
       "      <td>161663</td>\n",
       "      <td>1097</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>1309</td>\n",
       "      <td>670</td>\n",
       "      <td>96</td>\n",
       "      <td>16</td>\n",
       "      <td>12</td>\n",
       "      <td>1127.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>141.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522332</th>\n",
       "      <td>292991</td>\n",
       "      <td>3236</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>21858</td>\n",
       "      <td>6105</td>\n",
       "      <td>88</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>18342.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>1262.0</td>\n",
       "      <td>2204.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522333</th>\n",
       "      <td>293759</td>\n",
       "      <td>4954</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>4165</td>\n",
       "      <td>1476</td>\n",
       "      <td>158</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>3674.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>163.0</td>\n",
       "      <td>321.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522334</th>\n",
       "      <td>293759</td>\n",
       "      <td>2108</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>15287</td>\n",
       "      <td>4715</td>\n",
       "      <td>186</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "      <td>12731.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>1769.0</td>\n",
       "      <td>721.0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522335</th>\n",
       "      <td>228479</td>\n",
       "      <td>3473</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>27369</td>\n",
       "      <td>8238</td>\n",
       "      <td>399</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>24746.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>658.0</td>\n",
       "      <td>1927.0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>10105</td>\n",
       "      <td>4154</td>\n",
       "      <td>542</td>\n",
       "      <td>50</td>\n",
       "      <td>18</td>\n",
       "      <td>8997.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>687.0</td>\n",
       "      <td>412.0</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>5543</td>\n",
       "      <td>1592</td>\n",
       "      <td>352</td>\n",
       "      <td>93</td>\n",
       "      <td>19</td>\n",
       "      <td>4548.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>815.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>28892</td>\n",
       "      <td>7587</td>\n",
       "      <td>272</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>24602.0</td>\n",
       "      <td>94.0</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>1588.0</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>14027</td>\n",
       "      <td>4956</td>\n",
       "      <td>322</td>\n",
       "      <td>19</td>\n",
       "      <td>3</td>\n",
       "      <td>12807.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>793.0</td>\n",
       "      <td>398.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>25959</td>\n",
       "      <td>7927</td>\n",
       "      <td>952</td>\n",
       "      <td>175</td>\n",
       "      <td>85</td>\n",
       "      <td>21737.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>2700.0</td>\n",
       "      <td>1488.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 27 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 40
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:36:58.540853Z",
     "start_time": "2025-05-14T00:36:18.460578Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 统计用户在不同商家交互的 item_id, cat_id, brand_id 唯一值\n",
    "temp = groups[['item_id', 'cat_id', 'brand_id']].nunique().reset_index().rename(\n",
    "    columns={\n",
    "    'item_id':'um2',\n",
    "    'cat_id':'um3',\n",
    "    'brand_id':'um4'})\n",
    "all_data = all_data.merge(temp, on=['user_id', 'merchant_id'], how='left')\n"
   ],
   "id": "800e235b59ec45e7",
   "outputs": [],
   "execution_count": 41
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:38:12.579184Z",
     "start_time": "2025-05-14T00:38:12.537634Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.tail(10)",
   "id": "198df3e05e955b48",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522331   161663         1097   nan   test          0       0    36    36   \n",
       "522332   292991         3236   nan   test          2       0     9     9   \n",
       "522333   293759         4954   nan   test          3       1    77    77   \n",
       "522334   293759         2108   nan   test          3       1    77    77   \n",
       "522335   228479         3473   nan   test          6       0  2004  2004   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...   m4  m5       m6    m7      m8      m9  um1  um2  um3  \\\n",
       "522331    27  12  ...   16  12   1127.0   2.0   141.0    39.0    2    1    1   \n",
       "522332     5   3  ...    1   2  18342.0  50.0  1262.0  2204.0    6    2    1   \n",
       "522333    48  25  ...    9   2   3674.0   7.0   163.0   321.0    2    1    1   \n",
       "522334    48  25  ...   13   2  12731.0  66.0  1769.0   721.0    4    2    1   \n",
       "522335  1173  71  ...    6   2  24746.0  38.0   658.0  1927.0   42   13    4   \n",
       "522336  1173  71  ...   50  18   8997.0   9.0   687.0   412.0    5    2    1   \n",
       "522337    29  14  ...   93  19   4548.0   6.0   815.0   174.0    2    1    1   \n",
       "522338    29  14  ...    7   2  24602.0  94.0  2608.0  1588.0   16    5    2   \n",
       "522339    46  24  ...   19   3  12807.0  29.0   793.0   398.0    3    2    1   \n",
       "522340    46  24  ...  175  85  21737.0  34.0  2700.0  1488.0   11    1    1   \n",
       "\n",
       "        um4  \n",
       "522331    1  \n",
       "522332    1  \n",
       "522333    1  \n",
       "522334    1  \n",
       "522335    1  \n",
       "522336    1  \n",
       "522337    1  \n",
       "522338    1  \n",
       "522339    1  \n",
       "522340    1  \n",
       "\n",
       "[10 rows x 30 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>m4</th>\n",
       "      <th>m5</th>\n",
       "      <th>m6</th>\n",
       "      <th>m7</th>\n",
       "      <th>m8</th>\n",
       "      <th>m9</th>\n",
       "      <th>um1</th>\n",
       "      <th>um2</th>\n",
       "      <th>um3</th>\n",
       "      <th>um4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522331</th>\n",
       "      <td>161663</td>\n",
       "      <td>1097</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>16</td>\n",
       "      <td>12</td>\n",
       "      <td>1127.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>141.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522332</th>\n",
       "      <td>292991</td>\n",
       "      <td>3236</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>18342.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>1262.0</td>\n",
       "      <td>2204.0</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522333</th>\n",
       "      <td>293759</td>\n",
       "      <td>4954</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>3674.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>163.0</td>\n",
       "      <td>321.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522334</th>\n",
       "      <td>293759</td>\n",
       "      <td>2108</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "      <td>12731.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>1769.0</td>\n",
       "      <td>721.0</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522335</th>\n",
       "      <td>228479</td>\n",
       "      <td>3473</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>24746.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>658.0</td>\n",
       "      <td>1927.0</td>\n",
       "      <td>42</td>\n",
       "      <td>13</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>50</td>\n",
       "      <td>18</td>\n",
       "      <td>8997.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>687.0</td>\n",
       "      <td>412.0</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>93</td>\n",
       "      <td>19</td>\n",
       "      <td>4548.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>815.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>24602.0</td>\n",
       "      <td>94.0</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>1588.0</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>19</td>\n",
       "      <td>3</td>\n",
       "      <td>12807.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>793.0</td>\n",
       "      <td>398.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>175</td>\n",
       "      <td>85</td>\n",
       "      <td>21737.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>2700.0</td>\n",
       "      <td>1488.0</td>\n",
       "      <td>11</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 30 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 42
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:41:08.652185Z",
     "start_time": "2025-05-14T00:40:14.457708Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 统计用户在不同商家交互的 action_type 唯一值\n",
    "temp = groups['action_type'].value_counts().unstack().reset_index().rename(\n",
    "    columns={\n",
    "    0:'um5',\n",
    "    1:'um6',\n",
    "    2:'um7',\n",
    "    3:'um8'})\n",
    "all_data = all_data.merge(temp, on=['user_id', 'merchant_id'], how='left')\n",
    "\n"
   ],
   "id": "294c46a938debfad",
   "outputs": [],
   "execution_count": 43
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:41:26.790336Z",
     "start_time": "2025-05-14T00:41:26.746746Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.tail(10)",
   "id": "32c759003b71dcc9",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522331   161663         1097   nan   test          0       0    36    36   \n",
       "522332   292991         3236   nan   test          2       0     9     9   \n",
       "522333   293759         4954   nan   test          3       1    77    77   \n",
       "522334   293759         2108   nan   test          3       1    77    77   \n",
       "522335   228479         3473   nan   test          6       0  2004  2004   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...      m8      m9  um1  um2  um3  um4   um5  um6  um7  um8  \n",
       "522331    27  12  ...   141.0    39.0    2    1    1    1   1.0  NaN  1.0  NaN  \n",
       "522332     5   3  ...  1262.0  2204.0    6    2    1    1   5.0  NaN  1.0  NaN  \n",
       "522333    48  25  ...   163.0   321.0    2    1    1    1   1.0  NaN  1.0  NaN  \n",
       "522334    48  25  ...  1769.0   721.0    4    2    1    1   3.0  NaN  1.0  NaN  \n",
       "522335  1173  71  ...   658.0  1927.0   42   13    4    1  37.0  NaN  1.0  4.0  \n",
       "522336  1173  71  ...   687.0   412.0    5    2    1    1   4.0  NaN  1.0  NaN  \n",
       "522337    29  14  ...   815.0   174.0    2    1    1    1   1.0  NaN  1.0  NaN  \n",
       "522338    29  14  ...  2608.0  1588.0   16    5    2    1  12.0  NaN  4.0  NaN  \n",
       "522339    46  24  ...   793.0   398.0    3    2    1    1   2.0  NaN  1.0  NaN  \n",
       "522340    46  24  ...  2700.0  1488.0   11    1    1    1  10.0  NaN  1.0  NaN  \n",
       "\n",
       "[10 rows x 34 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>m8</th>\n",
       "      <th>m9</th>\n",
       "      <th>um1</th>\n",
       "      <th>um2</th>\n",
       "      <th>um3</th>\n",
       "      <th>um4</th>\n",
       "      <th>um5</th>\n",
       "      <th>um6</th>\n",
       "      <th>um7</th>\n",
       "      <th>um8</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522331</th>\n",
       "      <td>161663</td>\n",
       "      <td>1097</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>141.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522332</th>\n",
       "      <td>292991</td>\n",
       "      <td>3236</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>1262.0</td>\n",
       "      <td>2204.0</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522333</th>\n",
       "      <td>293759</td>\n",
       "      <td>4954</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>163.0</td>\n",
       "      <td>321.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522334</th>\n",
       "      <td>293759</td>\n",
       "      <td>2108</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>1769.0</td>\n",
       "      <td>721.0</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522335</th>\n",
       "      <td>228479</td>\n",
       "      <td>3473</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>658.0</td>\n",
       "      <td>1927.0</td>\n",
       "      <td>42</td>\n",
       "      <td>13</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>37.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>687.0</td>\n",
       "      <td>412.0</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>815.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>1588.0</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>12.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>793.0</td>\n",
       "      <td>398.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>2700.0</td>\n",
       "      <td>1488.0</td>\n",
       "      <td>11</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 34 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 44
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:42:19.390617Z",
     "start_time": "2025-05-14T00:41:54.891615Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 统计用户在不同商家购物时间间隔特征 um9 按照小时\n",
    "temp = groups['time_stamp'].agg([('F_time', 'min'), ('B_time', 'max')]).reset_index()\n",
    "temp['um9'] = (temp['B_time'] - temp['F_time']).dt.seconds/3600\n",
    "all_data = all_data.merge(temp[['user_id','merchant_id','um9']], on=['user_id', 'merchant_id'], how='left')\n",
    "\n",
    "del temp,groups\n",
    "gc.collect()"
   ],
   "id": "48ae92bb549878d2",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "49"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 45
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:42:32.846656Z",
     "start_time": "2025-05-14T00:42:32.805415Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.tail(10)",
   "id": "b7727ba0a7a855da",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522331   161663         1097   nan   test          0       0    36    36   \n",
       "522332   292991         3236   nan   test          2       0     9     9   \n",
       "522333   293759         4954   nan   test          3       1    77    77   \n",
       "522334   293759         2108   nan   test          3       1    77    77   \n",
       "522335   228479         3473   nan   test          6       0  2004  2004   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...      m9  um1  um2  um3  um4   um5  um6  um7  um8  \\\n",
       "522331    27  12  ...    39.0    2    1    1    1   1.0  NaN  1.0  NaN   \n",
       "522332     5   3  ...  2204.0    6    2    1    1   5.0  NaN  1.0  NaN   \n",
       "522333    48  25  ...   321.0    2    1    1    1   1.0  NaN  1.0  NaN   \n",
       "522334    48  25  ...   721.0    4    2    1    1   3.0  NaN  1.0  NaN   \n",
       "522335  1173  71  ...  1927.0   42   13    4    1  37.0  NaN  1.0  4.0   \n",
       "522336  1173  71  ...   412.0    5    2    1    1   4.0  NaN  1.0  NaN   \n",
       "522337    29  14  ...   174.0    2    1    1    1   1.0  NaN  1.0  NaN   \n",
       "522338    29  14  ...  1588.0   16    5    2    1  12.0  NaN  4.0  NaN   \n",
       "522339    46  24  ...   398.0    3    2    1    1   2.0  NaN  1.0  NaN   \n",
       "522340    46  24  ...  1488.0   11    1    1    1  10.0  NaN  1.0  NaN   \n",
       "\n",
       "             um9  \n",
       "522331  0.000000  \n",
       "522332  0.000000  \n",
       "522333  0.000000  \n",
       "522334  0.000000  \n",
       "522335  4.783333  \n",
       "522336  0.016667  \n",
       "522337  0.000000  \n",
       "522338  0.150000  \n",
       "522339  0.000000  \n",
       "522340  0.016667  \n",
       "\n",
       "[10 rows x 35 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>m9</th>\n",
       "      <th>um1</th>\n",
       "      <th>um2</th>\n",
       "      <th>um3</th>\n",
       "      <th>um4</th>\n",
       "      <th>um5</th>\n",
       "      <th>um6</th>\n",
       "      <th>um7</th>\n",
       "      <th>um8</th>\n",
       "      <th>um9</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522331</th>\n",
       "      <td>161663</td>\n",
       "      <td>1097</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>39.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522332</th>\n",
       "      <td>292991</td>\n",
       "      <td>3236</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>2204.0</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522333</th>\n",
       "      <td>293759</td>\n",
       "      <td>4954</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>321.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522334</th>\n",
       "      <td>293759</td>\n",
       "      <td>2108</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>721.0</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522335</th>\n",
       "      <td>228479</td>\n",
       "      <td>3473</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>1927.0</td>\n",
       "      <td>42</td>\n",
       "      <td>13</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>37.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.783333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>412.0</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.016667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>174.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>1588.0</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>12.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.150000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>398.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>1488.0</td>\n",
       "      <td>11</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.016667</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 35 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 46
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T00:43:00.675017Z",
     "start_time": "2025-05-14T00:43:00.613343Z"
    }
   },
   "cell_type": "code",
   "source": [
    "all_data['r1'] = all_data['u9']/all_data['u7']    # 用户购买点击比\n",
    "all_data['r2'] = all_data['m8']/all_data['m6']    # 商家购买点击比\n",
    "all_data['r3'] = all_data['um7']/all_data['um5']  # 不同用户不同商家购买点击比\n",
    "all_data.tail(10)"
   ],
   "id": "d5a89783d29fb7e8",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "522331   161663         1097   nan   test          0       0    36    36   \n",
       "522332   292991         3236   nan   test          2       0     9     9   \n",
       "522333   293759         4954   nan   test          3       1    77    77   \n",
       "522334   293759         2108   nan   test          3       1    77    77   \n",
       "522335   228479         3473   nan   test          6       0  2004  2004   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...  um3  um4   um5  um6  um7  um8       um9        r1  \\\n",
       "522331    27  12  ...    1    1   1.0  NaN  1.0  NaN  0.000000  0.064516   \n",
       "522332     5   3  ...    1    1   5.0  NaN  1.0  NaN  0.000000  0.285714   \n",
       "522333    48  25  ...    1    1   1.0  NaN  1.0  NaN  0.000000  0.062500   \n",
       "522334    48  25  ...    1    1   3.0  NaN  1.0  NaN  0.000000  0.062500   \n",
       "522335  1173  71  ...    4    1  37.0  NaN  1.0  4.0  4.783333  0.014689   \n",
       "522336  1173  71  ...    1    1   4.0  NaN  1.0  NaN  0.016667  0.014689   \n",
       "522337    29  14  ...    1    1   1.0  NaN  1.0  NaN  0.000000  0.173913   \n",
       "522338    29  14  ...    2    1  12.0  NaN  4.0  NaN  0.150000  0.173913   \n",
       "522339    46  24  ...    1    1   2.0  NaN  1.0  NaN  0.000000  0.129032   \n",
       "522340    46  24  ...    1    1  10.0  NaN  1.0  NaN  0.016667  0.129032   \n",
       "\n",
       "              r2        r3  \n",
       "522331  0.125111  1.000000  \n",
       "522332  0.068804  0.200000  \n",
       "522333  0.044366  1.000000  \n",
       "522334  0.138952  0.333333  \n",
       "522335  0.026590  0.027027  \n",
       "522336  0.076359  0.250000  \n",
       "522337  0.179200  1.000000  \n",
       "522338  0.106008  0.333333  \n",
       "522339  0.061919  0.500000  \n",
       "522340  0.124212  0.100000  \n",
       "\n",
       "[10 rows x 38 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>um3</th>\n",
       "      <th>um4</th>\n",
       "      <th>um5</th>\n",
       "      <th>um6</th>\n",
       "      <th>um7</th>\n",
       "      <th>um8</th>\n",
       "      <th>um9</th>\n",
       "      <th>r1</th>\n",
       "      <th>r2</th>\n",
       "      <th>r3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>522331</th>\n",
       "      <td>161663</td>\n",
       "      <td>1097</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "      <td>36</td>\n",
       "      <td>27</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.064516</td>\n",
       "      <td>0.125111</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522332</th>\n",
       "      <td>292991</td>\n",
       "      <td>3236</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>0.068804</td>\n",
       "      <td>0.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522333</th>\n",
       "      <td>293759</td>\n",
       "      <td>4954</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.062500</td>\n",
       "      <td>0.044366</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522334</th>\n",
       "      <td>293759</td>\n",
       "      <td>2108</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>77</td>\n",
       "      <td>77</td>\n",
       "      <td>48</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.062500</td>\n",
       "      <td>0.138952</td>\n",
       "      <td>0.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522335</th>\n",
       "      <td>228479</td>\n",
       "      <td>3473</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>37.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.783333</td>\n",
       "      <td>0.014689</td>\n",
       "      <td>0.026590</td>\n",
       "      <td>0.027027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.014689</td>\n",
       "      <td>0.076359</td>\n",
       "      <td>0.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.179200</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>12.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.150000</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.106008</td>\n",
       "      <td>0.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.129032</td>\n",
       "      <td>0.061919</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.129032</td>\n",
       "      <td>0.124212</td>\n",
       "      <td>0.100000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 38 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 47
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:00:23.321568Z",
     "start_time": "2025-05-14T01:00:23.192762Z"
    }
   },
   "cell_type": "code",
   "source": [
    "for col, count in all_data.isna().sum().items():\n",
    "    print(f\"{col}: {count}\")"
   ],
   "id": "a2903e7f3938b95c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "user_id: 0\n",
      "merchant_id: 0\n",
      "label: 0\n",
      "origin: 0\n",
      "age_range: 0\n",
      "gender: 0\n",
      "u1_x: 0\n",
      "u1_y: 0\n",
      "u2: 0\n",
      "u3: 0\n",
      "u4: 0\n",
      "u5: 0\n",
      "u6: 0\n",
      "u7: 360\n",
      "u8: 484162\n",
      "u9: 0\n",
      "u10: 227482\n",
      "m1: 0\n",
      "m2: 0\n",
      "m3: 0\n",
      "m4: 0\n",
      "m5: 0\n",
      "m6: 0\n",
      "m7: 4052\n",
      "m8: 0\n",
      "m9: 0\n",
      "um1: 0\n",
      "um2: 0\n",
      "um3: 0\n",
      "um4: 0\n",
      "um5: 59408\n",
      "um6: 512947\n",
      "um7: 0\n",
      "um8: 425790\n",
      "um9: 0\n",
      "r1: 360\n",
      "r2: 0\n",
      "r3: 59408\n"
     ]
    }
   ],
   "execution_count": 53
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:01:22.212905Z",
     "start_time": "2025-05-14T01:01:21.859684Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 控制填充\n",
    "all_data.fillna(0, inplace=True)\n",
    "for col, count in all_data.isna().sum().items():\n",
    "    print(f\"{col}: {count}\")"
   ],
   "id": "5693e1bb386d5b0c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "user_id: 0\n",
      "merchant_id: 0\n",
      "label: 0\n",
      "origin: 0\n",
      "age_range: 0\n",
      "gender: 0\n",
      "u1_x: 0\n",
      "u1_y: 0\n",
      "u2: 0\n",
      "u3: 0\n",
      "u4: 0\n",
      "u5: 0\n",
      "u6: 0\n",
      "u7: 0\n",
      "u8: 0\n",
      "u9: 0\n",
      "u10: 0\n",
      "m1: 0\n",
      "m2: 0\n",
      "m3: 0\n",
      "m4: 0\n",
      "m5: 0\n",
      "m6: 0\n",
      "m7: 0\n",
      "m8: 0\n",
      "m9: 0\n",
      "um1: 0\n",
      "um2: 0\n",
      "um3: 0\n",
      "um4: 0\n",
      "um5: 0\n",
      "um6: 0\n",
      "um7: 0\n",
      "um8: 0\n",
      "um9: 0\n",
      "r1: 0\n",
      "r2: 0\n",
      "r3: 0\n"
     ]
    }
   ],
   "execution_count": 54
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:03:10.507948Z",
     "start_time": "2025-05-14T01:03:10.461853Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.head(10)",
   "id": "e83da3bd7e934ffb",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   user_id  merchant_id label origin  age_range  gender  u1_x  u1_y   u2  u3  \\\n",
       "0    34176         3906   0.0  train          6       0   451   451  256  45   \n",
       "1    34176          121   0.0  train          6       0   451   451  256  45   \n",
       "2    34176         4356   1.0  train          6       0   451   451  256  45   \n",
       "3    34176         2217   0.0  train          6       0   451   451  256  45   \n",
       "4   230784         4818   0.0  train          0       0    54    54   31  17   \n",
       "5   362112         2618   0.0  train          4       1    89    89   57  13   \n",
       "6    34944         2051   0.0  train          5       0    33    33   21   7   \n",
       "7   231552         3828   1.0  train          5       0   155   155   94  25   \n",
       "8   231552         2124   0.0  train          5       0   155   155   94  25   \n",
       "9   232320         1168   0.0  train          4       1   111   111   63  19   \n",
       "\n",
       "   ...  um3  um4   um5  um6  um7  um8       um9        r1        r2        r3  \n",
       "0  ...    6    1  36.0  0.0  1.0  2.0  0.850000  0.082927  0.027572  0.027778  \n",
       "1  ...    1    1  13.0  0.0  1.0  0.0  0.050000  0.082927  0.066145  0.076923  \n",
       "2  ...    1    1  12.0  0.0  6.0  0.0  0.016667  0.082927  0.158024  0.500000  \n",
       "3  ...    1    1   1.0  0.0  1.0  0.0  0.000000  0.082927  0.071243  1.000000  \n",
       "4  ...    1    1   7.0  0.0  1.0  0.0  0.050000  0.148936  0.063164  0.142857  \n",
       "5  ...    1    1   0.0  0.0  1.0  0.0  0.000000  0.034884  0.153517  0.000000  \n",
       "6  ...    1    1   2.0  0.0  1.0  0.0  0.000000  0.100000  0.132211  0.500000  \n",
       "7  ...   15    1  78.0  0.0  5.0  0.0  0.100000  0.085106  0.028261  0.064103  \n",
       "8  ...    1    1   6.0  0.0  1.0  0.0  0.000000  0.085106  0.030903  0.166667  \n",
       "9  ...    1    1   2.0  0.0  1.0  1.0  0.116667  0.114286  0.080058  0.500000  \n",
       "\n",
       "[10 rows x 38 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>um3</th>\n",
       "      <th>um4</th>\n",
       "      <th>um5</th>\n",
       "      <th>um6</th>\n",
       "      <th>um7</th>\n",
       "      <th>um8</th>\n",
       "      <th>um9</th>\n",
       "      <th>r1</th>\n",
       "      <th>r2</th>\n",
       "      <th>r3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>36.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.850000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.027572</td>\n",
       "      <td>0.027778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.050000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.066145</td>\n",
       "      <td>0.076923</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>12.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.158024</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.071243</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>31</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.050000</td>\n",
       "      <td>0.148936</td>\n",
       "      <td>0.063164</td>\n",
       "      <td>0.142857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>362112</td>\n",
       "      <td>2618</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>89</td>\n",
       "      <td>57</td>\n",
       "      <td>13</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.034884</td>\n",
       "      <td>0.153517</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>34944</td>\n",
       "      <td>2051</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>33</td>\n",
       "      <td>33</td>\n",
       "      <td>21</td>\n",
       "      <td>7</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.132211</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>231552</td>\n",
       "      <td>3828</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>155</td>\n",
       "      <td>94</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>15</td>\n",
       "      <td>1</td>\n",
       "      <td>78.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.085106</td>\n",
       "      <td>0.028261</td>\n",
       "      <td>0.064103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>231552</td>\n",
       "      <td>2124</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>155</td>\n",
       "      <td>94</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.085106</td>\n",
       "      <td>0.030903</td>\n",
       "      <td>0.166667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>232320</td>\n",
       "      <td>1168</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>111</td>\n",
       "      <td>111</td>\n",
       "      <td>63</td>\n",
       "      <td>19</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.116667</td>\n",
       "      <td>0.114286</td>\n",
       "      <td>0.080058</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 38 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 55
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:15:41.565160Z",
     "start_time": "2025-05-14T01:15:41.409783Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 性别转换\n",
    "temp = pd.get_dummies(all_data['gender'], prefix='g')\n",
    "all_data = pd.concat([all_data, temp], axis=1) # 列进行合并"
   ],
   "id": "3f463b0d9e731cab",
   "outputs": [],
   "execution_count": 59
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:15:44.984426Z",
     "start_time": "2025-05-14T01:15:44.769793Z"
    }
   },
   "cell_type": "code",
   "source": "all_data",
   "id": "380e3b3cfe94be4",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "        user_id  merchant_id label origin  age_range  gender  u1_x  u1_y  \\\n",
       "0         34176         3906   0.0  train          6       0   451   451   \n",
       "1         34176          121   0.0  train          6       0   451   451   \n",
       "2         34176         4356   1.0  train          6       0   451   451   \n",
       "3         34176         2217   0.0  train          6       0   451   451   \n",
       "4        230784         4818   0.0  train          0       0    54    54   \n",
       "...         ...          ...   ...    ...        ...     ...   ...   ...   \n",
       "522336   228479         3111   nan   test          6       0  2004  2004   \n",
       "522337    97919         2341   nan   test          8       1    55    55   \n",
       "522338    97919         3971   nan   test          8       1    55    55   \n",
       "522339    32639         3536   nan   test          0       0    72    72   \n",
       "522340    32639         3319   nan   test          0       0    72    72   \n",
       "\n",
       "          u2  u3  ...  um6  um7  um8       um9        r1        r2        r3  \\\n",
       "0        256  45  ...  0.0  1.0  2.0  0.850000  0.082927  0.027572  0.027778   \n",
       "1        256  45  ...  0.0  1.0  0.0  0.050000  0.082927  0.066145  0.076923   \n",
       "2        256  45  ...  0.0  6.0  0.0  0.016667  0.082927  0.158024  0.500000   \n",
       "3        256  45  ...  0.0  1.0  0.0  0.000000  0.082927  0.071243  1.000000   \n",
       "4         31  17  ...  0.0  1.0  0.0  0.050000  0.148936  0.063164  0.142857   \n",
       "...      ...  ..  ...  ...  ...  ...       ...       ...       ...       ...   \n",
       "522336  1173  71  ...  0.0  1.0  0.0  0.016667  0.014689  0.076359  0.250000   \n",
       "522337    29  14  ...  0.0  1.0  0.0  0.000000  0.173913  0.179200  1.000000   \n",
       "522338    29  14  ...  0.0  4.0  0.0  0.150000  0.173913  0.106008  0.333333   \n",
       "522339    46  24  ...  0.0  1.0  0.0  0.000000  0.129032  0.061919  0.500000   \n",
       "522340    46  24  ...  0.0  1.0  0.0  0.016667  0.129032  0.124212  0.100000   \n",
       "\n",
       "          g_0    g_1    g_2  \n",
       "0        True  False  False  \n",
       "1        True  False  False  \n",
       "2        True  False  False  \n",
       "3        True  False  False  \n",
       "4        True  False  False  \n",
       "...       ...    ...    ...  \n",
       "522336   True  False  False  \n",
       "522337  False   True  False  \n",
       "522338  False   True  False  \n",
       "522339   True  False  False  \n",
       "522340   True  False  False  \n",
       "\n",
       "[522341 rows x 41 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>um6</th>\n",
       "      <th>um7</th>\n",
       "      <th>um8</th>\n",
       "      <th>um9</th>\n",
       "      <th>r1</th>\n",
       "      <th>r2</th>\n",
       "      <th>r3</th>\n",
       "      <th>g_0</th>\n",
       "      <th>g_1</th>\n",
       "      <th>g_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.850000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.027572</td>\n",
       "      <td>0.027778</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.050000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.066145</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.158024</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.082927</td>\n",
       "      <td>0.071243</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>31</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.050000</td>\n",
       "      <td>0.148936</td>\n",
       "      <td>0.063164</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522336</th>\n",
       "      <td>228479</td>\n",
       "      <td>3111</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2004</td>\n",
       "      <td>2004</td>\n",
       "      <td>1173</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.014689</td>\n",
       "      <td>0.076359</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522337</th>\n",
       "      <td>97919</td>\n",
       "      <td>2341</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.179200</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522338</th>\n",
       "      <td>97919</td>\n",
       "      <td>3971</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>55</td>\n",
       "      <td>55</td>\n",
       "      <td>29</td>\n",
       "      <td>14</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.150000</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.106008</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522339</th>\n",
       "      <td>32639</td>\n",
       "      <td>3536</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.129032</td>\n",
       "      <td>0.061919</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>522340</th>\n",
       "      <td>32639</td>\n",
       "      <td>3319</td>\n",
       "      <td>nan</td>\n",
       "      <td>test</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>0.129032</td>\n",
       "      <td>0.124212</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>522341 rows × 41 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 60
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:17:49.429641Z",
     "start_time": "2025-05-14T01:17:49.312831Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 修改age_range字段名称为 age_0, age_1, age_2... age_8\n",
    "# 独立编码\n",
    "temp = pd.get_dummies(all_data['age_range'], prefix='age')\n",
    "display(temp.head(10))\n",
    "all_data = pd.concat([all_data, temp], axis=1)"
   ],
   "id": "d9cbe249d46ba07c",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   age_0  age_1  age_2  age_3  age_4  age_5  age_6  age_7  age_8\n",
       "0  False  False  False  False  False  False   True  False  False\n",
       "1  False  False  False  False  False  False   True  False  False\n",
       "2  False  False  False  False  False  False   True  False  False\n",
       "3  False  False  False  False  False  False   True  False  False\n",
       "4   True  False  False  False  False  False  False  False  False\n",
       "5  False  False  False  False   True  False  False  False  False\n",
       "6  False  False  False  False  False   True  False  False  False\n",
       "7  False  False  False  False  False   True  False  False  False\n",
       "8  False  False  False  False  False   True  False  False  False\n",
       "9  False  False  False  False   True  False  False  False  False"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age_0</th>\n",
       "      <th>age_1</th>\n",
       "      <th>age_2</th>\n",
       "      <th>age_3</th>\n",
       "      <th>age_4</th>\n",
       "      <th>age_5</th>\n",
       "      <th>age_6</th>\n",
       "      <th>age_7</th>\n",
       "      <th>age_8</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 61
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:18:08.993317Z",
     "start_time": "2025-05-14T01:18:08.957462Z"
    }
   },
   "cell_type": "code",
   "source": "all_data.head(10)",
   "id": "4b69f6ae5fb3811f",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   user_id  merchant_id label origin  age_range  gender  u1_x  u1_y   u2  u3  \\\n",
       "0    34176         3906   0.0  train          6       0   451   451  256  45   \n",
       "1    34176          121   0.0  train          6       0   451   451  256  45   \n",
       "2    34176         4356   1.0  train          6       0   451   451  256  45   \n",
       "3    34176         2217   0.0  train          6       0   451   451  256  45   \n",
       "4   230784         4818   0.0  train          0       0    54    54   31  17   \n",
       "5   362112         2618   0.0  train          4       1    89    89   57  13   \n",
       "6    34944         2051   0.0  train          5       0    33    33   21   7   \n",
       "7   231552         3828   1.0  train          5       0   155   155   94  25   \n",
       "8   231552         2124   0.0  train          5       0   155   155   94  25   \n",
       "9   232320         1168   0.0  train          4       1   111   111   63  19   \n",
       "\n",
       "   ...    g_2  age_0  age_1  age_2  age_3  age_4  age_5  age_6  age_7  age_8  \n",
       "0  ...  False  False  False  False  False  False  False   True  False  False  \n",
       "1  ...  False  False  False  False  False  False  False   True  False  False  \n",
       "2  ...  False  False  False  False  False  False  False   True  False  False  \n",
       "3  ...  False  False  False  False  False  False  False   True  False  False  \n",
       "4  ...  False   True  False  False  False  False  False  False  False  False  \n",
       "5  ...  False  False  False  False  False   True  False  False  False  False  \n",
       "6  ...  False  False  False  False  False  False   True  False  False  False  \n",
       "7  ...  False  False  False  False  False  False   True  False  False  False  \n",
       "8  ...  False  False  False  False  False  False   True  False  False  False  \n",
       "9  ...  False  False  False  False  False   True  False  False  False  False  \n",
       "\n",
       "[10 rows x 50 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>merchant_id</th>\n",
       "      <th>label</th>\n",
       "      <th>origin</th>\n",
       "      <th>age_range</th>\n",
       "      <th>gender</th>\n",
       "      <th>u1_x</th>\n",
       "      <th>u1_y</th>\n",
       "      <th>u2</th>\n",
       "      <th>u3</th>\n",
       "      <th>...</th>\n",
       "      <th>g_2</th>\n",
       "      <th>age_0</th>\n",
       "      <th>age_1</th>\n",
       "      <th>age_2</th>\n",
       "      <th>age_3</th>\n",
       "      <th>age_4</th>\n",
       "      <th>age_5</th>\n",
       "      <th>age_6</th>\n",
       "      <th>age_7</th>\n",
       "      <th>age_8</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>34176</td>\n",
       "      <td>3906</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>34176</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>34176</td>\n",
       "      <td>4356</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34176</td>\n",
       "      <td>2217</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>451</td>\n",
       "      <td>451</td>\n",
       "      <td>256</td>\n",
       "      <td>45</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>230784</td>\n",
       "      <td>4818</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>31</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>362112</td>\n",
       "      <td>2618</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>89</td>\n",
       "      <td>57</td>\n",
       "      <td>13</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>34944</td>\n",
       "      <td>2051</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>33</td>\n",
       "      <td>33</td>\n",
       "      <td>21</td>\n",
       "      <td>7</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>231552</td>\n",
       "      <td>3828</td>\n",
       "      <td>1.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>155</td>\n",
       "      <td>94</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>231552</td>\n",
       "      <td>2124</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>155</td>\n",
       "      <td>94</td>\n",
       "      <td>25</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>232320</td>\n",
       "      <td>1168</td>\n",
       "      <td>0.0</td>\n",
       "      <td>train</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>111</td>\n",
       "      <td>111</td>\n",
       "      <td>63</td>\n",
       "      <td>19</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 50 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 62
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:18:17.954173Z",
     "start_time": "2025-05-14T01:18:17.510438Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 删除原数据\n",
    "all_data.drop(['age_range', 'gender'], axis=1, inplace=True)\n",
    " \n",
    "del temp\n",
    "gc.collect()"
   ],
   "id": "9d4aa6098661547",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "249"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 63
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:32:55.223919Z",
     "start_time": "2025-05-14T01:32:32.052510Z"
    }
   },
   "cell_type": "code",
   "source": [
    "%%time\n",
    "# train_data、test-data\n",
    "train_data = all_data[all_data['origin'] == 'train'].drop(['origin'], axis=1)\n",
    "test_data = all_data[all_data['origin'] == 'test'].drop(['label', 'origin'], axis=1)\n",
    " \n",
    "train_data.to_csv('train_data.csv')\n",
    "test_data.to_csv('test_data.csv')"
   ],
   "id": "9bffe86c2466d935",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: total: 22.6 s\n",
      "Wall time: 23.2 s\n"
     ]
    }
   ],
   "execution_count": 71
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "ba5ca55bef554610"
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "算法建模预测",
   "id": "2224bd11e9f6a330"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:26:35.324403Z",
     "start_time": "2025-05-14T01:26:35.267295Z"
    }
   },
   "cell_type": "code",
   "source": [
    "train_x=train_data.drop('label',axis=1)\n",
    "train_y=train_data['label']\n",
    "train_x.shape,train_y.shape"
   ],
   "id": "b6d0c01a4c808195",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((260864, 46), (260864,))"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 69
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T01:32:10.897080Z",
     "start_time": "2025-05-14T01:32:09.293355Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(train_x, train_y, test_size=0.3, random_state=42)\n"
   ],
   "id": "c23d1d20d04d6971",
   "outputs": [],
   "execution_count": 70
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T02:48:44.050306Z",
     "start_time": "2025-05-14T02:48:44.034430Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import lightgbm as lgb\n",
    "model_lgb = lgb.LGBMClassifier(\n",
    "        max_depth=8, # 8 # 树最大的深度\n",
    "        num_leaves= 31,\n",
    "        n_estimators=5000, # 集成算法，树数量\n",
    "        colsample_bytree=0.7, # 特征筛选\n",
    "        subsample=0.9,  # 样本采样比例\n",
    "        verbosity= -1,\n",
    "        learning_rate=0.1) # 学习率\n",
    "\n",
    "model_lgb\n"
   ],
   "id": "39ba3ce28967d68",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)"
      ],
      "text/html": [
       "<style>#sk-container-id-10 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-10 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-10 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-10 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-10 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-10 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-10 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-10 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-10 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-10 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-10 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-10 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-10 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-10 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-10 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-10 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-10 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-10 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-10\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-10\" type=\"checkbox\" checked><label for=\"sk-estimator-id-10\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>LGBMClassifier</div></div><div><span class=\"sk-estimator-doc-link \">i<span>Not fitted</span></span></div></label><div class=\"sk-toggleable__content \"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre></div> </div></div></div></div>"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 95
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T02:49:27.891817Z",
     "start_time": "2025-05-14T02:48:46.167546Z"
    }
   },
   "cell_type": "code",
   "source": "model_lgb.fit(X_train,y_train)",
   "id": "812e3da37e453419",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)"
      ],
      "text/html": [
       "<style>#sk-container-id-11 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-11 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-11 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-11 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-11 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-11 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-11 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-11 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-11 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-11 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-11 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-11 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-11 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-11 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-11 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-11 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-11 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-11 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-11\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-11\" type=\"checkbox\" checked><label for=\"sk-estimator-id-11\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>LGBMClassifier</div></div><div><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre></div> </div></div></div></div>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 96
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T02:49:39.168927Z",
     "start_time": "2025-05-14T02:49:30.245855Z"
    }
   },
   "cell_type": "code",
   "source": [
    "y_predict_lgb=model_lgb.predict(X_test)\n",
    "y_predict_lgb"
   ],
   "id": "17a20a50366e73af",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['0.0', '0.0', '0.0', ..., '0.0', '0.0', '0.0'],\n",
       "      shape=(78260,), dtype=object)"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 97
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T03:03:03.723072Z",
     "start_time": "2025-05-14T03:03:03.091680Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from sklearn.metrics import roc_auc_score\n",
    "print(roc_auc_score(y_test,y_predict_lgb))"
   ],
   "id": "ffb32924db4e0744",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5023844282665566\n"
     ]
    }
   ],
   "execution_count": 100
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:47:11.941042Z",
     "start_time": "2025-05-14T06:47:11.912587Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "gsc_lgb=GridSearchCV(\n",
    "    model_lgb,\n",
    "    param_grid={\n",
    "       'objective': ['multiclass'],\n",
    "          'metric': ['multi_logloss'],\n",
    "          'min_child_weight': [1.5],\n",
    "          'num_leaves':[ 2**5],\n",
    "          'lambda_l2': [10],\n",
    "          'subsample': [0.7],\n",
    "          'colsample_bytree': [0.7],\n",
    "          'colsample_bylevel': [0.7],\n",
    "          'learning_rate': [0.03],\n",
    "          'tree_method': ['exact'],\n",
    "          'seed': [2017],\n",
    "          \"num_class\": [2],\n",
    "          'silent':[ True]\n",
    "    },\n",
    "    cv=3\n",
    ")\n",
    "gsc_lgb"
   ],
   "id": "534e03f0b51ff474",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={'colsample_bylevel': [0.7], 'colsample_bytree': [0.7],\n",
       "                         'lambda_l2': [10], 'learning_rate': [0.03],\n",
       "                         'metric': ['multi_logloss'], 'min_child_weight': [1.5],\n",
       "                         'num_class': [2], 'num_leaves': [32],\n",
       "                         'objective': ['multiclass'], 'seed': [2017],\n",
       "                         'silent': [True], 'subsample': [0.7],\n",
       "                         'tree_method': ['exact']})"
      ],
      "text/html": [
       "<style>#sk-container-id-31 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-31 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-31 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-31 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-31 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-31 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-31 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-31 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-31 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-31 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-31 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-31 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-31 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-31 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-31 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-31 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-31 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-31 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-31\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={&#x27;colsample_bylevel&#x27;: [0.7], &#x27;colsample_bytree&#x27;: [0.7],\n",
       "                         &#x27;lambda_l2&#x27;: [10], &#x27;learning_rate&#x27;: [0.03],\n",
       "                         &#x27;metric&#x27;: [&#x27;multi_logloss&#x27;], &#x27;min_child_weight&#x27;: [1.5],\n",
       "                         &#x27;num_class&#x27;: [2], &#x27;num_leaves&#x27;: [32],\n",
       "                         &#x27;objective&#x27;: [&#x27;multiclass&#x27;], &#x27;seed&#x27;: [2017],\n",
       "                         &#x27;silent&#x27;: [True], &#x27;subsample&#x27;: [0.7],\n",
       "                         &#x27;tree_method&#x27;: [&#x27;exact&#x27;]})</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-67\" type=\"checkbox\" ><label for=\"sk-estimator-id-67\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>GridSearchCV</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.model_selection.GridSearchCV.html\">?<span>Documentation for GridSearchCV</span></a><span class=\"sk-estimator-doc-link \">i<span>Not fitted</span></span></div></label><div class=\"sk-toggleable__content \"><pre>GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={&#x27;colsample_bylevel&#x27;: [0.7], &#x27;colsample_bytree&#x27;: [0.7],\n",
       "                         &#x27;lambda_l2&#x27;: [10], &#x27;learning_rate&#x27;: [0.03],\n",
       "                         &#x27;metric&#x27;: [&#x27;multi_logloss&#x27;], &#x27;min_child_weight&#x27;: [1.5],\n",
       "                         &#x27;num_class&#x27;: [2], &#x27;num_leaves&#x27;: [32],\n",
       "                         &#x27;objective&#x27;: [&#x27;multiclass&#x27;], &#x27;seed&#x27;: [2017],\n",
       "                         &#x27;silent&#x27;: [True], &#x27;subsample&#x27;: [0.7],\n",
       "                         &#x27;tree_method&#x27;: [&#x27;exact&#x27;]})</pre></div> </div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-68\" type=\"checkbox\" ><label for=\"sk-estimator-id-68\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>estimator: LGBMClassifier</div></div></label><div class=\"sk-toggleable__content \"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-69\" type=\"checkbox\" ><label for=\"sk-estimator-id-69\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>LGBMClassifier</div></div></label><div class=\"sk-toggleable__content \"><pre>LGBMClassifier(colsample_bytree=0.7, max_depth=8, n_estimators=5000,\n",
       "               subsample=0.9, verbosity=-1)</pre></div> </div></div></div></div></div></div></div></div></div>"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 158
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:52:38.035102Z",
     "start_time": "2025-05-14T06:47:15.987839Z"
    }
   },
   "cell_type": "code",
   "source": "gsc_lgb.fit(X_train,y_train)",
   "id": "fa271e0635315029",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={'colsample_bylevel': [0.7], 'colsample_bytree': [0.7],\n",
       "                         'lambda_l2': [10], 'learning_rate': [0.03],\n",
       "                         'metric': ['multi_logloss'], 'min_child_weight': [1.5],\n",
       "                         'num_class': [2], 'num_leaves': [32],\n",
       "                         'objective': ['multiclass'], 'seed': [2017],\n",
       "                         'silent': [True], 'subsample': [0.7],\n",
       "                         'tree_method': ['exact']})"
      ],
      "text/html": [
       "<style>#sk-container-id-32 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-32 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-32 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-32 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-32 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-32 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-32 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-32 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-32 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-32 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-32 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-32 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-32 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-32 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-32 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-32 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-32 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-32 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-32\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={&#x27;colsample_bylevel&#x27;: [0.7], &#x27;colsample_bytree&#x27;: [0.7],\n",
       "                         &#x27;lambda_l2&#x27;: [10], &#x27;learning_rate&#x27;: [0.03],\n",
       "                         &#x27;metric&#x27;: [&#x27;multi_logloss&#x27;], &#x27;min_child_weight&#x27;: [1.5],\n",
       "                         &#x27;num_class&#x27;: [2], &#x27;num_leaves&#x27;: [32],\n",
       "                         &#x27;objective&#x27;: [&#x27;multiclass&#x27;], &#x27;seed&#x27;: [2017],\n",
       "                         &#x27;silent&#x27;: [True], &#x27;subsample&#x27;: [0.7],\n",
       "                         &#x27;tree_method&#x27;: [&#x27;exact&#x27;]})</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-70\" type=\"checkbox\" ><label for=\"sk-estimator-id-70\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>GridSearchCV</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.model_selection.GridSearchCV.html\">?<span>Documentation for GridSearchCV</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>GridSearchCV(cv=3,\n",
       "             estimator=LGBMClassifier(colsample_bytree=0.7, max_depth=8,\n",
       "                                      n_estimators=5000, subsample=0.9,\n",
       "                                      verbosity=-1),\n",
       "             param_grid={&#x27;colsample_bylevel&#x27;: [0.7], &#x27;colsample_bytree&#x27;: [0.7],\n",
       "                         &#x27;lambda_l2&#x27;: [10], &#x27;learning_rate&#x27;: [0.03],\n",
       "                         &#x27;metric&#x27;: [&#x27;multi_logloss&#x27;], &#x27;min_child_weight&#x27;: [1.5],\n",
       "                         &#x27;num_class&#x27;: [2], &#x27;num_leaves&#x27;: [32],\n",
       "                         &#x27;objective&#x27;: [&#x27;multiclass&#x27;], &#x27;seed&#x27;: [2017],\n",
       "                         &#x27;silent&#x27;: [True], &#x27;subsample&#x27;: [0.7],\n",
       "                         &#x27;tree_method&#x27;: [&#x27;exact&#x27;]})</pre></div> </div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-71\" type=\"checkbox\" ><label for=\"sk-estimator-id-71\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>best_estimator_: LGBMClassifier</div></div></label><div class=\"sk-toggleable__content fitted\"><pre>LGBMClassifier(colsample_bylevel=0.7, colsample_bytree=0.7, lambda_l2=10,\n",
       "               learning_rate=0.03, max_depth=8, metric=&#x27;multi_logloss&#x27;,\n",
       "               min_child_weight=1.5, n_estimators=5000, num_class=2,\n",
       "               num_leaves=32, objective=&#x27;multiclass&#x27;, seed=2017, silent=True,\n",
       "               subsample=0.7, tree_method=&#x27;exact&#x27;, verbosity=-1)</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-72\" type=\"checkbox\" ><label for=\"sk-estimator-id-72\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>LGBMClassifier</div></div></label><div class=\"sk-toggleable__content fitted\"><pre>LGBMClassifier(colsample_bylevel=0.7, colsample_bytree=0.7, lambda_l2=10,\n",
       "               learning_rate=0.03, max_depth=8, metric=&#x27;multi_logloss&#x27;,\n",
       "               min_child_weight=1.5, n_estimators=5000, num_class=2,\n",
       "               num_leaves=32, objective=&#x27;multiclass&#x27;, seed=2017, silent=True,\n",
       "               subsample=0.7, tree_method=&#x27;exact&#x27;, verbosity=-1)</pre></div> </div></div></div></div></div></div></div></div></div>"
      ]
     },
     "execution_count": 159,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 159
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:53:06.178753Z",
     "start_time": "2025-05-14T06:53:06.144336Z"
    }
   },
   "cell_type": "code",
   "source": [
    "results=pd.DataFrame(gsc_lgb.cv_results_)\n",
    "results"
   ],
   "id": "8e7af491545c68f5",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   mean_fit_time  std_fit_time  mean_score_time  std_score_time  \\\n",
       "0      62.727071      1.908737        18.208487         1.46945   \n",
       "\n",
       "   param_colsample_bylevel  param_colsample_bytree  param_lambda_l2  \\\n",
       "0                      0.7                     0.7               10   \n",
       "\n",
       "   param_learning_rate   param_metric  param_min_child_weight  ...  \\\n",
       "0                 0.03  multi_logloss                     1.5  ...   \n",
       "\n",
       "   param_silent  param_subsample param_tree_method  \\\n",
       "0          True              0.7             exact   \n",
       "\n",
       "                                              params  split0_test_score  \\\n",
       "0  {'colsample_bylevel': 0.7, 'colsample_bytree':...           0.938178   \n",
       "\n",
       "   split1_test_score split2_test_score mean_test_score  std_test_score  \\\n",
       "0           0.938358          0.938457        0.938331        0.000116   \n",
       "\n",
       "   rank_test_score  \n",
       "0                1  \n",
       "\n",
       "[1 rows x 24 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>mean_fit_time</th>\n",
       "      <th>std_fit_time</th>\n",
       "      <th>mean_score_time</th>\n",
       "      <th>std_score_time</th>\n",
       "      <th>param_colsample_bylevel</th>\n",
       "      <th>param_colsample_bytree</th>\n",
       "      <th>param_lambda_l2</th>\n",
       "      <th>param_learning_rate</th>\n",
       "      <th>param_metric</th>\n",
       "      <th>param_min_child_weight</th>\n",
       "      <th>...</th>\n",
       "      <th>param_silent</th>\n",
       "      <th>param_subsample</th>\n",
       "      <th>param_tree_method</th>\n",
       "      <th>params</th>\n",
       "      <th>split0_test_score</th>\n",
       "      <th>split1_test_score</th>\n",
       "      <th>split2_test_score</th>\n",
       "      <th>mean_test_score</th>\n",
       "      <th>std_test_score</th>\n",
       "      <th>rank_test_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>62.727071</td>\n",
       "      <td>1.908737</td>\n",
       "      <td>18.208487</td>\n",
       "      <td>1.46945</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0.7</td>\n",
       "      <td>10</td>\n",
       "      <td>0.03</td>\n",
       "      <td>multi_logloss</td>\n",
       "      <td>1.5</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>0.7</td>\n",
       "      <td>exact</td>\n",
       "      <td>{'colsample_bylevel': 0.7, 'colsample_bytree':...</td>\n",
       "      <td>0.938178</td>\n",
       "      <td>0.938358</td>\n",
       "      <td>0.938457</td>\n",
       "      <td>0.938331</td>\n",
       "      <td>0.000116</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 24 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 160,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 160
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:53:09.294931Z",
     "start_time": "2025-05-14T06:53:09.284650Z"
    }
   },
   "cell_type": "code",
   "source": [
    "print(\"score\",gsc_lgb.best_score_)\n",
    "print(\"params\",gsc_lgb.best_params_)\n",
    "print(\"estimator\",gsc_lgb.best_estimator_)"
   ],
   "id": "e35e1402f574d71a",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "score 0.938331033274189\n",
      "params {'colsample_bylevel': 0.7, 'colsample_bytree': 0.7, 'lambda_l2': 10, 'learning_rate': 0.03, 'metric': 'multi_logloss', 'min_child_weight': 1.5, 'num_class': 2, 'num_leaves': 32, 'objective': 'multiclass', 'seed': 2017, 'silent': True, 'subsample': 0.7, 'tree_method': 'exact'}\n",
      "estimator LGBMClassifier(colsample_bylevel=0.7, colsample_bytree=0.7, lambda_l2=10,\n",
      "               learning_rate=0.03, max_depth=8, metric='multi_logloss',\n",
      "               min_child_weight=1.5, n_estimators=5000, num_class=2,\n",
      "               num_leaves=32, objective='multiclass', seed=2017, silent=True,\n",
      "               subsample=0.7, tree_method='exact', verbosity=-1)\n"
     ]
    }
   ],
   "execution_count": 161
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:53:32.507821Z",
     "start_time": "2025-05-14T06:53:11.439700Z"
    }
   },
   "cell_type": "code",
   "source": "print(roc_auc_score(y_test,gsc_lgb.best_estimator_.predict(X_test)))",
   "id": "9b6954b328f4f354",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5016224662310527\n"
     ]
    }
   ],
   "execution_count": 162
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:09:03.592176Z",
     "start_time": "2025-05-14T06:09:03.355444Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import xgboost as xgb\n",
    "model_xgb=xgb.XGBClassifier()\n"
   ],
   "id": "e11c1492cc4f28a6",
   "outputs": [],
   "execution_count": 133
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:13:29.198633Z",
     "start_time": "2025-05-14T06:13:29.086608Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看 y 的数据类型和唯一值\n",
    "print(\"y 的类型:\", type(y_train[0]))\n",
    "print(\"唯一值:\", y_train.unique())\n",
    "\n",
    "# 将字符串标签转换为整数\n",
    "y_train = y_train.astype(float).astype(int)  # 先转浮点再转整数（避免直接转换失败）\n",
    "\n",
    "\n",
    "# 验证转换结果\n",
    "print(\"转换后唯一值:\", y_train.unique())"
   ],
   "id": "659c1916737ac7e3",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "y 的类型: <class 'str'>\n",
      "唯一值: ['0.0' '1.0']\n",
      "转换后唯一值: [0 1]\n"
     ]
    }
   ],
   "execution_count": 136
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:13:33.810684Z",
     "start_time": "2025-05-14T06:13:31.173478Z"
    }
   },
   "cell_type": "code",
   "source": "model_xgb.fit(X_train,y_train)",
   "id": "71553eee2430fa95",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
       "              colsample_bylevel=None, colsample_bynode=None,\n",
       "              colsample_bytree=None, device=None, early_stopping_rounds=None,\n",
       "              enable_categorical=False, eval_metric=None, feature_types=None,\n",
       "              feature_weights=None, gamma=None, grow_policy=None,\n",
       "              importance_type=None, interaction_constraints=None,\n",
       "              learning_rate=None, max_bin=None, max_cat_threshold=None,\n",
       "              max_cat_to_onehot=None, max_delta_step=None, max_depth=None,\n",
       "              max_leaves=None, min_child_weight=None, missing=nan,\n",
       "              monotone_constraints=None, multi_strategy=None, n_estimators=None,\n",
       "              n_jobs=None, num_parallel_tree=None, ...)"
      ],
      "text/html": [
       "<style>#sk-container-id-24 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-24 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-24 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-24 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-24 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-24 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-24 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-24 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-24 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-24 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-24 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-24 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-24 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-24 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-24 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-24 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-24 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-24 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-24\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
       "              colsample_bylevel=None, colsample_bynode=None,\n",
       "              colsample_bytree=None, device=None, early_stopping_rounds=None,\n",
       "              enable_categorical=False, eval_metric=None, feature_types=None,\n",
       "              feature_weights=None, gamma=None, grow_policy=None,\n",
       "              importance_type=None, interaction_constraints=None,\n",
       "              learning_rate=None, max_bin=None, max_cat_threshold=None,\n",
       "              max_cat_to_onehot=None, max_delta_step=None, max_depth=None,\n",
       "              max_leaves=None, min_child_weight=None, missing=nan,\n",
       "              monotone_constraints=None, multi_strategy=None, n_estimators=None,\n",
       "              n_jobs=None, num_parallel_tree=None, ...)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-48\" type=\"checkbox\" checked><label for=\"sk-estimator-id-48\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>XGBClassifier</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://xgboost.readthedocs.io/en/release_3.0.0/python/python_api.html#xgboost.XGBClassifier\">?<span>Documentation for XGBClassifier</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
       "              colsample_bylevel=None, colsample_bynode=None,\n",
       "              colsample_bytree=None, device=None, early_stopping_rounds=None,\n",
       "              enable_categorical=False, eval_metric=None, feature_types=None,\n",
       "              feature_weights=None, gamma=None, grow_policy=None,\n",
       "              importance_type=None, interaction_constraints=None,\n",
       "              learning_rate=None, max_bin=None, max_cat_threshold=None,\n",
       "              max_cat_to_onehot=None, max_delta_step=None, max_depth=None,\n",
       "              max_leaves=None, min_child_weight=None, missing=nan,\n",
       "              monotone_constraints=None, multi_strategy=None, n_estimators=None,\n",
       "              n_jobs=None, num_parallel_tree=None, ...)</pre></div> </div></div></div></div>"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 137
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:16:03.613474Z",
     "start_time": "2025-05-14T06:16:03.508140Z"
    }
   },
   "cell_type": "code",
   "source": "y_predict_xgb=model_xgb.predict(X_test)",
   "id": "4a84afd854e1f6f2",
   "outputs": [],
   "execution_count": 139
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T06:16:09.658452Z",
     "start_time": "2025-05-14T06:16:09.169612Z"
    }
   },
   "cell_type": "code",
   "source": "print(roc_auc_score(y_test,y_predict_xgb))",
   "id": "ed9632dd83d976f8",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.501819794367978\n"
     ]
    }
   ],
   "execution_count": 140
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "gsc_lgb=GridSearchCV(\n",
    "    model_xgb,\n",
    "    param_grid={\n",
    "        'num_leaves':[16,31],\n",
    "        'max_depth':[6,30,100],\n",
    "        'n_estimators':[50,500,2000],\n",
    "        'learning_rate':[0.05,0.1]\n",
    "    },\n",
    "    cv=3\n",
    ")\n",
    "gsc_lgb"
   ],
   "id": "b32e36913f238c08"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "3447f418d1cb2e9b"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T07:46:41.830884Z",
     "start_time": "2025-05-14T07:46:37.038873Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lg=LogisticRegression(\n",
    "       penalty='l2',             # L2 正则化（默认），防止过拟合\n",
    "    C=1.0,                    # 正则化强度的倒数，较小的值表示更强的正则化\n",
    "    solver='lbfgs',           # 适用于小数据集的优化算法\n",
    "    max_iter=100,             # 最大迭代次数\n",
    ")\n",
    "lg.fit(X_train,y_train)"
   ],
   "id": "57cd4d9abdfe3705",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression()"
      ],
      "text/html": [
       "<style>#sk-container-id-34 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-34 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-34 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-34 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-34 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-34 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-34 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-34 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-34 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-34 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-34 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-34 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-34 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-34 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-34 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-34 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-34 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-34 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-34\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LogisticRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-74\" type=\"checkbox\" checked><label for=\"sk-estimator-id-74\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>LogisticRegression</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression()</pre></div> </div></div></div></div>"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 166
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T07:46:47.253381Z",
     "start_time": "2025-05-14T07:46:47.208617Z"
    }
   },
   "cell_type": "code",
   "source": "y_predict_lg=lg.predict(X_test)",
   "id": "3aa06190ff9e43c1",
   "outputs": [],
   "execution_count": 167
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T07:46:49.565076Z",
     "start_time": "2025-05-14T07:46:49.063744Z"
    }
   },
   "cell_type": "code",
   "source": "print(roc_auc_score(y_test,y_predict_lg))",
   "id": "dd835d91469c6d99",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5\n"
     ]
    }
   ],
   "execution_count": 168
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T07:52:22.863292Z",
     "start_time": "2025-05-14T07:52:22.844482Z"
    }
   },
   "cell_type": "code",
   "source": [
    "gsc_lg=GridSearchCV(\n",
    "    lg,\n",
    "    param_grid={\n",
    "        'penalty':['l1', 'l2', 'elasticnet'],\n",
    "        'C':[0.5,1.0],\n",
    "        'solver':['lbfgs', 'liblinear', 'newton-cg']\n",
    "    },\n",
    "    cv=3\n",
    ")\n",
    "gsc_lg"
   ],
   "id": "7a29573e0f7db8dd",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={'C': [0.5, 1.0], 'penalty': ['l1', 'l2', 'elasticnet'],\n",
       "                         'solver': ['lbfgs', 'liblinear', 'newton-cg']})"
      ],
      "text/html": [
       "<style>#sk-container-id-35 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-35 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-35 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-35 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-35 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-35 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-35 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-35 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-35 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-35 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-35 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-35 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-35 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-35 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-35 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-35 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-35 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-35 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-35\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={&#x27;C&#x27;: [0.5, 1.0], &#x27;penalty&#x27;: [&#x27;l1&#x27;, &#x27;l2&#x27;, &#x27;elasticnet&#x27;],\n",
       "                         &#x27;solver&#x27;: [&#x27;lbfgs&#x27;, &#x27;liblinear&#x27;, &#x27;newton-cg&#x27;]})</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-75\" type=\"checkbox\" ><label for=\"sk-estimator-id-75\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>GridSearchCV</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.model_selection.GridSearchCV.html\">?<span>Documentation for GridSearchCV</span></a><span class=\"sk-estimator-doc-link \">i<span>Not fitted</span></span></div></label><div class=\"sk-toggleable__content \"><pre>GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={&#x27;C&#x27;: [0.5, 1.0], &#x27;penalty&#x27;: [&#x27;l1&#x27;, &#x27;l2&#x27;, &#x27;elasticnet&#x27;],\n",
       "                         &#x27;solver&#x27;: [&#x27;lbfgs&#x27;, &#x27;liblinear&#x27;, &#x27;newton-cg&#x27;]})</pre></div> </div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-76\" type=\"checkbox\" ><label for=\"sk-estimator-id-76\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>estimator: LogisticRegression</div></div></label><div class=\"sk-toggleable__content \"><pre>LogisticRegression()</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-77\" type=\"checkbox\" ><label for=\"sk-estimator-id-77\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>LogisticRegression</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a></div></label><div class=\"sk-toggleable__content \"><pre>LogisticRegression()</pre></div> </div></div></div></div></div></div></div></div></div>"
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 169
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-05-14T07:58:07.746962Z",
     "start_time": "2025-05-14T07:52:37.301282Z"
    }
   },
   "cell_type": "code",
   "source": "gsc_lg.fit(X_train,y_train)",
   "id": "285f50a41dd4a3bb",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={'C': [0.5, 1.0], 'penalty': ['l1', 'l2', 'elasticnet'],\n",
       "                         'solver': ['lbfgs', 'liblinear', 'newton-cg']})"
      ],
      "text/html": [
       "<style>#sk-container-id-36 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-36 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-36 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-36 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-36 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-36 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-36 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-36 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-36 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-36 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-36 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-36 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-36 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-36 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-36 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-36 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-36 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-36 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-36\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={&#x27;C&#x27;: [0.5, 1.0], &#x27;penalty&#x27;: [&#x27;l1&#x27;, &#x27;l2&#x27;, &#x27;elasticnet&#x27;],\n",
       "                         &#x27;solver&#x27;: [&#x27;lbfgs&#x27;, &#x27;liblinear&#x27;, &#x27;newton-cg&#x27;]})</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-78\" type=\"checkbox\" ><label for=\"sk-estimator-id-78\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>GridSearchCV</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.model_selection.GridSearchCV.html\">?<span>Documentation for GridSearchCV</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>GridSearchCV(cv=3, estimator=LogisticRegression(),\n",
       "             param_grid={&#x27;C&#x27;: [0.5, 1.0], &#x27;penalty&#x27;: [&#x27;l1&#x27;, &#x27;l2&#x27;, &#x27;elasticnet&#x27;],\n",
       "                         &#x27;solver&#x27;: [&#x27;lbfgs&#x27;, &#x27;liblinear&#x27;, &#x27;newton-cg&#x27;]})</pre></div> </div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-79\" type=\"checkbox\" ><label for=\"sk-estimator-id-79\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>best_estimator_: LogisticRegression</div></div></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression(C=0.5)</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-80\" type=\"checkbox\" ><label for=\"sk-estimator-id-80\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>LogisticRegression</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a></div></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression(C=0.5)</pre></div> </div></div></div></div></div></div></div></div></div>"
      ]
     },
     "execution_count": 170,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 170
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "print(roc_auc_score(y_test,gsc_lg.predict(X_test)))",
   "id": "1ba5034c807c1157"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
